Merge pull request #10456 from minestarks/types2.0-merge

Merge master -> types-2.0
This commit is contained in:
Mine Starks
2016-08-04 09:59:42 -07:00
committed by GitHub
57 changed files with 11326 additions and 501 deletions
+1
View File
@@ -245,6 +245,7 @@ declare module 'angular' {
extendPalette(name: string, palette: IPalette): IPalette;
setDefaultTheme(theme: string): void;
alwaysWatchTheme(alwaysWatch: boolean): void;
setNonce(nonce: string): void;
}
interface IDateLocaleProvider {
+1
View File
@@ -93,6 +93,7 @@ declare module 'angular' {
use(key: string): ITranslateProvider;
storageKey(): string;
storageKey(key: string): void; // JeroMiya - the library should probably return ITranslateProvider but it doesn't here
uniformLanguageTag(options: string | Object): ITranslateProvider;
useUrlLoader(url: string): ITranslateProvider;
useStaticFilesLoader(options: IStaticFilesLoaderOptions | { files: IStaticFilesLoaderOptions[] }): ITranslateProvider;
useLoader(loaderFactory: string, options?: any): ITranslateProvider;
+7 -6
View File
@@ -120,14 +120,14 @@ declare namespace angular {
fromJson(json: string): any;
identity<T>(arg?: T): T;
injector(modules?: any[], strictDi?: boolean): auto.IInjectorService;
isArray(value: any): boolean;
isDate(value: any): boolean;
isArray(value: any): value is Array<any>;
isDate(value: any): value is Date;
isDefined(value: any): boolean;
isElement(value: any): boolean;
isFunction(value: any): boolean;
isNumber(value: any): boolean;
isObject(value: any): boolean;
isString(value: any): boolean;
isFunction(value: any): value is Function;
isNumber(value: any): value is number;
isObject(value: any): value is Object;
isString(value: any): value is string;
isUndefined(value: any): boolean;
lowercase(str: string): string;
@@ -389,6 +389,7 @@ declare namespace angular {
$invalid: boolean;
$submitted: boolean;
$error: any;
$name: string;
$pending: any;
$addControl(control: INgModelController | IFormController): void;
$removeControl(control: INgModelController | IFormController): void;
+1
View File
@@ -165,6 +165,7 @@ declare namespace autobahn {
}
interface IPublishOptions {
acknowledge?: boolean;
exclude?: number[];
eligible?: number[];
disclose_me?: Boolean;
+328 -29
View File
@@ -43,6 +43,10 @@ export declare class Endpoint {
protocol: string;
}
interface AwsError extends Error {
stack: string;
}
export interface Services {
autoscaling?: any;
cloudformation?: any;
@@ -110,46 +114,114 @@ export interface ClientConfig extends ClientConfigPartial {
region: string;
}
export declare class Lambda {
constructor(options?: any);
endpoint: Endpoint;
addPermission(params: Lambda.AddPermissionParams, callback: (err: AwsError, data: any) => void): void;
createAlias(params: Lambda.CreateAliasParams, callback: (err: AwsError, data: any) => void): void;
createEventSourceMapping(params: Lambda.CreateEventSourceMappingParams, callback: (err: AwsError, data: any) => void): void;
createFunction(params: Lambda.CreateFunctionParams, callback: (err: AwsError, data: any) => void): void;
deleteAlias(params: Lambda.DeleteAliasParams, callback: (err: AwsError, data: any) => void): void;
deleteEventSourceMapping(params: Lambda.DeleteEventSourceMappingParams, callback: (err: AwsError, data: any) => void): void;
deleteFunction(params: Lambda.DeleteFunctionParams, callback: (err: AwsError, data: any) => void): void;
getAlias(params: Lambda.GetAliasParams, callback: (err: AwsError, data: any) => void): void;
getEventSourceMapping(params: Lambda.GetEventSourceMappingParams, callback: (err: AwsError, data: any) => void): void;
getFunction(params: Lambda.GetFunctionParams, callback: (err: AwsError, data: any) => void): void;
getFunctionConfiguration(params: Lambda.GetFunctionConfigurationParams, callback: (err: AwsError, data: any) => void): void;
getPolicy(params: Lambda.GetPolicyParams, callback: (err: AwsError, data: any) => void): void;
invoke(params: Lambda.InvokeParams, callback: (err: AwsError, data: any) => void): void;
listAliases(params: Lambda.ListAliasesParams, callback: (err: AwsError, data: any) => void): void;
listEventSourceMappings(params: Lambda.ListEventSourceMappingsParams, callback: (err: AwsError, data: any) => void): void;
listFunctions(params: Lambda.ListFunctionsParams, callback: (err: AwsError, data: any) => void): void;
listVersionsByFunction(params: Lambda.ListVersionsByFunctionParams, callback: (err: AwsError, data: any) => void): void;
publishVersion(params: Lambda.PublishVersionParams, callback: (err: AwsError, data: any) => void): void;
removePermission(params: Lambda.RemovePermissionParams, callback: (err: AwsError, data: any) => void): void;
updateAlias(params: Lambda.UpdateAliasParams, callback: (err: AwsError, data: any) => void): void;
updateEventSourceMapping(params: Lambda.UpdateEventSourceMappingParams, callback: (err: AwsError, data: any) => void): void;
updateFunctionCode(params: Lambda.UpdateFunctionCodeParams, callback: (err: AwsError, data: any) => void): void;
updateFunctionConfiguration(params: Lambda.UpdateFunctionConfigurationParams, callback: (err: AwsError, data: any) => void): void;
}
export declare class SQS {
constructor(options?: any);
endpoint: Endpoint;
addPermission(params: SQS.AddPermissionParams, callback: (err: Error, data: any) => void): void;
changeMessageVisibility(params: SQS.ChangeMessageVisibilityParams, callback: (err: Error, data: any) => void): void;
changeMessageVisibilityBatch(params: SQS.ChangeMessageVisibilityBatchParams, callback: (err: Error, data: SQS.ChangeMessageVisibilityBatchResponse) => void): void;
createQueue(params: SQS.CreateQueueParams, callback: (err: Error, data: SQS.CreateQueueResult) => void): void;
deleteMessage(params: SQS.DeleteMessageParams, callback: (err: Error, data: any) => void): void;
deleteMessageBatch(params: SQS.DeleteMessageBatchParams, callback: (err: Error, data: SQS.DeleteMessageBatchResult) => void): void;
deleteQueue(params: { QueueUrl: string; }, callback: (err: Error, data: any) => void): void;
getQueueAttributes(params: SQS.GetQueueAttributesParams, callback: (err: Error, data: SQS.GetQueueAttributesResult) => void): void;
getQueueUrl(params: SQS.GetQueueUrlParams, callback: (err: Error, data: { QueueUrl: string; }) => void): void;
listDeadLetterSourceQueues(params: { QueueUrl: string }, callback: (err: Error, data: { queueUrls: string[] }) => void): void;
listQueues(params: { QueueNamePrefix?: string }, callback: (err: Error, data: { QueueUrls: string[] }) => void): void;
purgeQueue(params: { QueueUrl: string }, callback: (err: Error, data: any) => void): void;
receiveMessage(params: SQS.ReceiveMessageParams, callback: (err: Error, data: SQS.ReceiveMessageResult) => void): void;
removePermission(params: { QueueUrl: string, Label: string }, callback: (err: Error, data: any) => void): void;
sendMessage(params: SQS.SendMessageParams, callback: (err: Error, data: SQS.SendMessageResult) => void): void;
sendMessageBatch(params: SQS.SendMessageBatchParams, callback: (err: Error, data: SQS.SendMessageBatchResult) => void): void;
setQueueAttributes(params: SQS.SetQueueAttributesParams, callback: (err: Error, data: any) => void): void;
addPermission(params: SQS.AddPermissionParams, callback: (err: AwsError, data: any) => void): void;
changeMessageVisibility(params: SQS.ChangeMessageVisibilityParams, callback: (err: AwsError, data: any) => void): void;
changeMessageVisibilityBatch(params: SQS.ChangeMessageVisibilityBatchParams, callback: (err: AwsError, data: SQS.ChangeMessageVisibilityBatchResponse) => void): void;
createQueue(params: SQS.CreateQueueParams, callback: (err: AwsError, data: SQS.CreateQueueResult) => void): void;
deleteMessage(params: SQS.DeleteMessageParams, callback: (err: AwsError, data: any) => void): void;
deleteMessageBatch(params: SQS.DeleteMessageBatchParams, callback: (err: AwsError, data: SQS.DeleteMessageBatchResult) => void): void;
deleteQueue(params: { QueueUrl: string; }, callback: (err: AwsError, data: any) => void): void;
getQueueAttributes(params: SQS.GetQueueAttributesParams, callback: (err: AwsError, data: SQS.GetQueueAttributesResult) => void): void;
getQueueUrl(params: SQS.GetQueueUrlParams, callback: (err: AwsError, data: { QueueUrl: string; }) => void): void;
listDeadLetterSourceQueues(params: { QueueUrl: string }, callback: (err: AwsError, data: { queueUrls: string[] }) => void): void;
listQueues(params: { QueueNamePrefix?: string }, callback: (err: AwsError, data: { QueueUrls: string[] }) => void): void;
purgeQueue(params: { QueueUrl: string }, callback: (err: AwsError, data: any) => void): void;
receiveMessage(params: SQS.ReceiveMessageParams, callback: (err: AwsError, data: SQS.ReceiveMessageResult) => void): void;
removePermission(params: { QueueUrl: string, Label: string }, callback: (err: AwsError, data: any) => void): void;
sendMessage(params: SQS.SendMessageParams, callback: (err: AwsError, data: SQS.SendMessageResult) => void): void;
sendMessageBatch(params: SQS.SendMessageBatchParams, callback: (err: AwsError, data: SQS.SendMessageBatchResult) => void): void;
setQueueAttributes(params: SQS.SetQueueAttributesParams, callback: (err: AwsError, data: any) => void): void;
}
export declare class SES {
constructor(options?: any);
public client: Ses.Client;
endpoint: Endpoint;
sendEmail(params: any, callback: (err: any, data: SES.SendEmailResult) => void): void;
}
export declare class SNS {
constructor(options?: any);
endpoint: Endpoint;
publish(request: Sns.PublishRequest, callback: (err: any, data: any) => void): void;
}
export declare class SimpleWorkflow {
export declare class SWF {
constructor(options?: any);
public client: Swf.Client;
endpoint: Endpoint;
countClosedWorkflowExecutions(params: any, callback: (err: any, data: any) => void): void;
countOpenWorkflowExecutions(params: any, callback: (err: any, data: any) => void): void;
countPendingActivityTasks(params: any, callback: (err: any, data: any) => void): void;
countPendingDecisionTasks(params: any, callback: (err: any, data: any) => void): void;
deprecateActivityType(params: any, callback: (err: any, data: any) => void): void;
deprecateDomain(params: any, callback: (err: any, data: any) => void): void;
deprecateWorkflowType(params: any, callback: (err: any, data: any) => void): void;
describeActivityType(params: any, callback: (err: any, data: any) => void): void;
describeDomain(params: any, callback: (err: any, data: any) => void): void;
describeWorkflowExecution(params: any, callback: (err: any, data: any) => void): void;
describeWorkflowType(params: any, callback: (err: any, data: any) => void): void;
getWorkflowExecutionHistory(params: any, callback: (err: any, data: any) => void): void;
listActivityTypes(params: any, callback: (err: any, data: any) => void): void;
listClosedWorkflowExecutions(params: any, callback: (err: any, data: any) => void): void;
listDomains(params: any, callback: (err: any, data: any) => void): void;
listOpenWorkflowExecutions(params: any, callback: (err: any, data: any) => void): void;
listWorkflowTypes(params: any, callback: (err: any, data: any) => void): void;
pollForActivityTask(params: any, callback: (err: any, data: Swf.ActivityTask) => void): void;
pollForDecisionTask(params: any, callback: (err: any, data: Swf.DecisionTask) => void): void;
recordActivityTaskHeartbeat(params: any, callback: (err: any, data: any) => void): void;
registerActivityType(params: any, callback: (err: any, data: any) => void): void;
registerDomain(params: any, callback: (err: any, data: any) => void): void;
registerWorkflowType(params: any, callback: (err: any, data: any) => void): void;
requestCancelWorkflowExecution(params: any, callback: (err: any, data: any) => void): void;
respondActivityTaskCanceled(params: Swf.RespondActivityTaskCanceledRequest, callback: (err: any, data: any) => void): void;
respondActivityTaskCompleted(params: Swf.RespondActivityTaskCompletedRequest, callback: (err: any, data: any) => void): void;
respondActivityTaskFailed(params: Swf.RespondActivityTaskFailedRequest, callback: (err: any, data: any) => void): void;
respondDecisionTaskCompleted(params: Swf.RespondDecisionTaskCompletedRequest, callback: (err: any, data: any) => void): void;
signalWorkflowExecution(params: any, callback: (err: any, data: any) => void): void;
startWorkflowExecution(params: any, callback: (err: any, data: Swf.StartWorkflowExecutionResult) => void): void;
terminateWorkflowExecution(params: any, callback: (err: any, data: any) => void): void;
}
export declare class S3 {
constructor(options?: any);
endpoint: Endpoint;
getObject(params: s3.GetObjectRequest, callback: (err: Error, data: any) => void): void;
putObject(params: s3.PutObjectRequest, callback: (err: Error, data: any) => void): void;
deleteObject(params: s3.DeleteObjectRequest, callback: (err: Error, data: any) => void): void;
@@ -157,11 +229,14 @@ export declare class S3 {
getSignedUrl(operation: string, params: any): string;
getSignedUrl(operation: string, params: any, callback: (err: Error, url: string) => void): void;
upload(params?: s3.PutObjectRequest, options?: s3.UploadOptions, callback?: (err: Error, data: any) => void): void;
listObjects(params: s3.ListObjectRequest, callback: (err: Error, data: s3.ListObjectResponse) => void): void;
listObjectsV2(params: s3.ListObjectV2Request, callback: (err: Error, data: s3.ListObjectV2Response) => void): void;
}
export class STS {
constructor(options?: any);
endpoint: Endpoint;
/**
* Returns a set of temporary security credentials (consisting of an access key ID, a secret access key, and a security token) that you can use to access AWS resources that you might not normally have access to.
*/
@@ -205,9 +280,10 @@ export class STS {
export declare class ECS {
constructor(options?: any);
endpoint: Endpoint;
/**
* Runs and maintains a desired number of tasks from a specified task definition. If the number of tasks running in a service drops below desiredCount, Amazon ECS spawns another instantiation of the task in the specified cluster. To update an existing service, see UpdateService.
*/
* Runs and maintains a desired number of tasks from a specified task definition. If the number of tasks running in a service drops below desiredCount, Amazon ECS spawns another instantiation of the task in the specified cluster. To update an existing service, see UpdateService.
*/
createService(params: ecs.CreateServicesParams, callback: (err: any, data: any) => void): void;
/**
* Describes one or more of your clusters.
@@ -237,6 +313,8 @@ export declare class ECS {
export declare class DynamoDB {
constructor(options?: any);
endpoint: Endpoint;
}
// ==========================================================
@@ -339,11 +417,172 @@ export declare module DynamoDB {
// ===========================================================
// ===========================================================
export declare module Lambda {
export interface AddPermissionParams {
Action: string;
FunctionName: string;
Principal: string;
StatementId: string;
Qualifier?: string;
SourceAccount?: string;
SourceArn?: string;
}
// ===========================================================
export interface CreateAliasParams {
FunctionName: string;
FunctionVersion: string;
Name: string;
Description?: string;
}
export interface CreateEventSourceMappingParams {
EventSourceArn: string;
FunctionName: string;
StartingPosition: string; /* TRIM_HORIZON | LATEST */
BatchSize?: number;
Enabled?: boolean
}
// ===========================================================
export interface CreateFunctionParams {
Code: {
S3Bucket?: string;
S3Key?: string;
S3ObjectVersion?: string;
ZipFile?: any; // new Buffer('...') || string;
},
FunctionName: string;
Handler: string;
Role: string;
Runtime: string; /* 'nodejs | java8 | python2.7', */
Description?: string;
MemorySize?: number;
Publish?: boolean;
Timeout?: number;
VpcConfig?: {
SecurityGroupIds?: string[];
SubnetIds?: string[];
}
}
export interface DeleteAliasParams {
FunctionName: string;
Name: string;
}
export interface DeleteEventSourceMappingParams {
UUID: string;
}
export interface DeleteFunctionParams {
FunctionName: string;
Qualifier?: string;
}
export interface GetAliasParams {
FunctionName: string;
Name: string;
}
export interface GetEventSourceMappingParams {
UUID: string;
}
export interface GetFunctionParams {
FunctionName: string;
Qualifier?: string;
}
export interface GetFunctionConfigurationParams {
FunctionName: string;
Qualifier?: string;
}
export interface GetPolicyParams {
FunctionName: string;
Qualifier?: string;
}
export interface InvokeParams {
FunctionName: string;
ClientContext?: string;
InvocationType?: string;/* 'Event | RequestResponse | DryRun' */
LogType?: string; /* 'None | Tail' */
Payload?: any; /* new Buffer('...') || string */
Qualifier?: string;
}
export interface ListAliasesParams {
FunctionName: string;
FunctionVersion?: string;
Marker?: string;
MaxItems?: number
}
export interface ListEventSourceMappingsParams {
EventSourceArn?: string;
FunctionName?: string;
Marker?: string;
MaxItems?: number
}
export interface ListFunctionsParams {
Marker?: string;
MaxItems?: number
}
export interface ListVersionsByFunctionParams {
FunctionName: string;
Marker?: string;
MaxItems?: number
}
export interface PublishVersionParams {
FunctionName: string;
CodeSha256?: string;
Description?: string;
}
export interface RemovePermissionParams {
FunctionName: string;
StatementId: string;
Qualifier?: string;
}
export interface UpdateAliasParams {
FunctionName: string;
Name: string;
Description?: string;
FunctionVersion?: string;
}
export interface UpdateEventSourceMappingParams {
UUID: string;
BatchSize?: number;
Enabled?: boolean;
FunctionName?: string;
}
export interface UpdateFunctionCodeParams {
FunctionName: string;
Publish?: boolean;
S3Bucket?: string;
S3Key?: string;
S3ObjectVersion?: string;
ZipFile?: any; /* new Buffer('...') || string; */
}
export interface UpdateFunctionConfigurationParams {
FunctionName: string;
Description?: string;
Handler?: string;
MemorySize?: number;
Role?: string;
Timeout?: number;
VpcConfig?: {
SecurityGroupIds?: string[];
SubnetIds?: string[];
}
}
}
export declare module SQS {
@@ -492,7 +731,7 @@ export declare module SQS {
export interface MessageAttribute {
StringValue?: string;
BinaryValue?: any; //(Buffer, Typed Array, Blob, String)
BinaryValue?: any; //(Buffer, Typed Array, Blob, String)
StringListValues?: string[];
BinaryListValues?: any[];
DataType: string;
@@ -537,7 +776,7 @@ export declare module SQS {
}
export declare module Ses {
export declare module SES {
export interface Client {
config: ClientConfig;
@@ -582,9 +821,9 @@ export declare module Ses {
export declare module Swf {
export class Client {
export interface Client {
//constructor(options?: any);
public config: ClientConfig;
config: ClientConfig;
countClosedWorkflowExecutions(params: any, callback: (err: any, data: any) => void): void;
countOpenWorkflowExecutions(params: any, callback: (err: any, data: any) => void): void;
@@ -1235,6 +1474,44 @@ export declare module Sns {
}
export declare module s3 {
interface Owner {
DisplayName: string;
ID: string;
}
interface ObjectKeyPrefix {
Prefix: string;
}
export interface ListObjectContent {
Key: string;
LastModified: Date;
ETag: string;
Size: number;
StorageClass: "STANDARD" | "REDUCED_REDUNDANCY" | "GLACIER";
Owner?: Owner
}
// This private interface contains the common parts between v1 and v2 of the API Request and is exposed via V1 and V2 subclasses
interface ListObjectRequestBase {
Bucket: string;
Delimiter?: string;
EncodingType?: 'url';
MaxKeys?: number;
Prefix?: string;
}
// This private interface contains the common parts between v1 and v2 of the API Response and is exposed via V1 and V2 subclasses
interface ListObjectResponseBase {
IsTruncated: boolean;
Contents: ListObjectContent[];
Name: string;
Prefix?: string;
Delimiter?: string;
MaxKeys: number;
CommonPrefixes?: ObjectKeyPrefix[];
EncodingType?: "url";
}
export interface PutObjectRequest {
ACL?: string;
@@ -1303,6 +1580,28 @@ export declare module s3 {
partSize?: number;
queueSize?: number;
}
export interface ListObjectRequest extends ListObjectRequestBase {
Marker?: string;
}
export interface ListObjectV2Request extends ListObjectRequestBase {
ContinuationToken?: string;
FetchOwner?: boolean;
StartAfter?: string;
}
export interface ListObjectResponse extends ListObjectResponseBase {
Marker?: string;
NextMarker?: string;
}
export interface ListObjectV2Response extends ListObjectResponseBase {
KeyCount: number;
ContinuationToken?: string;
NextContinuationToken?: string;
StartAfter?: string;
}
}
export declare module ecs {
+6 -1
View File
@@ -12,6 +12,7 @@
// Updated Jan 20 2015 for Breeze 1.5.2 and merging changes from DefinitelyTyped
// Updated Feb 28 2015 add any/all clause on Predicate
// Updated Jun 27 2016 - Marcel Good (www.ideablade.com)
// Updated Jul 28 2016 - Serkan "coni2k" Holat
declare namespace breeze.core {
@@ -1043,6 +1044,10 @@ declare namespace breeze.config {
@return {an instance of the specified adapter}
**/
export function getAdapterInstance(interfaceName: string, adapterName?: string): Object;
export interface Adapter {
getRoutePrefix: Function
}
/**
Initializes a single adapter implementation. Initialization means either newing a instance of the
specified interface and then calling "initialize" on it or simply calling "initialize" on the instance
@@ -1052,7 +1057,7 @@ declare namespace breeze.config {
@param isDefault=true {Boolean} - Whether to make this the default "adapter" for this interface.
@return {an instance of the specified adapter}
**/
export function initializeAdapterInstance(interfaceName: string, adapterName: string, isDefault?: boolean): void;
export function initializeAdapterInstance(interfaceName: string, adapterName: string, isDefault?: boolean): Adapter;
export interface AdapterInstancesConfig {
/** the name of a previously registered "ajax" adapter */
+24 -9
View File
@@ -1,15 +1,30 @@
import * as credential from 'credential';
// all from current main repo examples
credential.hash('password', function(err: Error, hash: string) {
if (err) console.error(err);
else console.log(hash);
import credential = require("credential");
var pw = credential();
var newPassword = 'I have a really great password.';
pw.hash(newPassword, function(err, hash) {
if (err) { throw err; }
console.log('Store the password hash.', hash);
});
const hash = '{}';
const password = 'test';
var storedHash = {
"hash": "gNofnhlBl36AdRyktwATxKoqWKa6hsIEzwCmW/YXN//7PtiJwCRbepV9fUKu0L9TJELCKoDiBy6rGM8ov7lg2yLY",
"salt": "yyN3KUzlr4KrKWMM2K3d2Ddxf8OTq+vkKG+mtnmQVIibxSJz8drfzkYzqcH0EM+PVKR/1nClRr/CPDuJsq+FOcIw",
"keyLength": 66,
"hashMethod": "pbkdf2",
"iterations": 181019
};
var userInput = 'I have a really great password.';
credential.verify(hash, password, function(err: Error, isValid: boolean) {
if (err) console.error(err);
else console.log(isValid ? 'Password match' : 'Incorrect password');
pw.verify(storedHash, userInput, function(err, isValid) {
var msg: string;
if (err) { throw err; }
msg = isValid ? 'Passwords match!' : 'Wrong password.';
console.log(msg);
});
+22 -4
View File
@@ -4,13 +4,31 @@
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
interface defaultOptions {
keyLength: number;
work: number;
hashMethod: string;
}
type HashCallback = (err: Error, hash: string) => void;
interface hashObject {
hash: string;
salt: string;
keyLength: number;
hashMethod: string;
iterations: number;
}
type HashCallback = (err: Error, hash: hashObject) => void;
type VerifyCallback = (err: Error, isValid: boolean) => void;
declare namespace credential {
function hash(password: string, callback: HashCallback): void;
function verify(hash: string, password: string, callback: VerifyCallback): void;
declare function credential(defaultOptions?: defaultOptions): {
hash(password: string, callback: HashCallback): void;
hash(password: string): Promise<hashObject>;
// iterations(work: number, base): number;
verify(hash: hashObject | string, password: string, callback: VerifyCallback): void;
verify(hash: hashObject | string, password: string): Promise<boolean>;
expired(hash: string, days: number): boolean;
}
export = credential;
+2 -2
View File
@@ -58,8 +58,8 @@ declare namespace stringify {
interface Stringifier extends NodeJS.ReadWriteStream {
// Stringifier stream takes array of strings
write(line: string[]): boolean;
// Stringifier stream takes array of strings or Object
write(line: string[] | Object): boolean;
// repeat declarations from NodeJS.WritableStream to avoid compile error
write(buffer: Buffer, cb?: Function): boolean;
+6
View File
@@ -0,0 +1,6 @@
/// <reference path="elastic.js.d.ts"/>
let body = new elasticjs.Request({})
.query(new elasticjs.MatchQuery('title_field', 'testQuery'))
.facet(new elasticjs.TermsFacet('tags').field('tags'))
.toJSON();
+8972
View File
File diff suppressed because it is too large Load Diff
+24 -2
View File
@@ -23,8 +23,8 @@ declare module Elasticsearch {
ping(params: PingParams, callback: (err: any, response: any, status: any) => void): void;
scroll(params: ScrollParams): PromiseLike<any>;
scroll(params: ScrollParams, callback: (error: any, response: any) => void): void;
search(params: SearchParams): PromiseLike<any>;
search(params: SearchParams, callback: (error: any, response: any) => void): void;
search<T>(params: SearchParams): PromiseLike<SearchResponse<T>>;
search<T>(params: SearchParams, callback: (error: any, response: SearchResponse<T>) => void): void;
suggest(params: SuggestParams): PromiseLike<any>;
suggest(params: SuggestParams, callback: (error: any, response: any) => void): void;
update(params: UpdateDocumentParams): PromiseLike<any>;
@@ -219,6 +219,28 @@ declare module Elasticsearch {
timeout?: Date | number;
}
export interface SearchResponse<T> {
took: number,
timed_out: boolean,
_shards: {
total: number,
successful: number,
failed: number
},
hits: {
total: number,
max_score: number,
hits: {
_index: string,
_type: string,
_id: string,
_score: number,
_source: T
}[]
},
aggregations: any
}
export interface MSearchParams extends GenericParams {
index?: string | string[] | Boolean;
type?: string | string[] | Boolean;
+1 -2
View File
@@ -137,7 +137,7 @@ app.on('ready', () => {
mainWindow.webContents.capturePage(image => {
console.log(image.toDataURL());
});
mainWindow.webContents.capturePage({width: 100, height: 200}, image => {
mainWindow.webContents.capturePage({x: 0, y: 0, width: 100, height: 200}, image => {
console.log(image.toPNG());
});
});
@@ -284,7 +284,6 @@ app.on('ready', () => {
app.commandLine.appendSwitch('remote-debugging-port', '8315');
app.commandLine.appendSwitch('host-rules', 'MAP * 127.0.0.1');
app.commandLine.appendSwitch('v', '-1');
app.commandLine.appendSwitch('vmodule', 'console=0');
// systemPreferences
+36 -43
View File
@@ -25,6 +25,23 @@ declare namespace Electron {
sender: EventEmitter;
}
type Point = {
x: number;
y: number;
}
type Size = {
width: number;
height: number;
}
type Rectangle = {
x: number;
y: number;
width: number;
height: number;
}
// https://github.com/electron/electron/blob/master/docs/api/app.md
/**
@@ -844,7 +861,7 @@ declare namespace Electron {
*
* Note: This API is available only on macOS.
*/
setAspectRatio(aspectRatio: number, extraSize?: Dimension): void;
setAspectRatio(aspectRatio: number, extraSize?: Size): void;
/**
* Resizes and moves the window to width, height, x, y.
*/
@@ -1112,7 +1129,7 @@ declare namespace Electron {
*
* Note: This API is available only on Windows.
*/
setThumbnailClip(region: Bounds): void;
setThumbnailClip(region: Rectangle): void;
/**
* Same as webContents.showDefinitionForSelection().
* Note: This API is available only on macOS.
@@ -1360,7 +1377,7 @@ declare namespace Electron {
backgroundThrottling?: boolean;
}
interface BrowserWindowOptions extends Rectangle {
interface BrowserWindowOptions {
/**
* Window’s width in pixels.
* Default: 800.
@@ -1570,13 +1587,6 @@ declare namespace Electron {
type BrowserWindowTypeMac = 'desktop' | 'textured';
type BrowserWindowTypeWindows = 'toolbar';
interface Rectangle {
x?: number;
y?: number;
width?: number;
height?: number;
}
// https://github.com/electron/electron/blob/master/docs/api/clipboard.md
/**
@@ -1853,7 +1863,7 @@ declare namespace Electron {
* The suggested size that thumbnail should be scaled.
* Default: {width: 150, height: 150}
*/
thumbnailSize?: Dimension;
thumbnailSize?: Size;
}
interface DesktopCapturerSource {
@@ -2452,7 +2462,7 @@ declare namespace Electron {
/**
* @returns {} The size of the image.
*/
getSize(): Dimension;
getSize(): Size;
/**
* Marks the image as template image.
*/
@@ -2675,10 +2685,10 @@ declare namespace Electron {
* Unique identifier associated with the display.
*/
id: number;
bounds: Bounds;
workArea: Bounds;
size: Dimension;
workAreaSize: Dimension;
bounds: Rectangle;
workArea: Rectangle;
size: Size;
workAreaSize: Size;
/**
* Output device’s pixel scale factor.
*/
@@ -2690,23 +2700,6 @@ declare namespace Electron {
touchSupport: 'available' | 'unavailable' | 'unknown';
}
type Bounds = {
x: number;
y: number;
width: number;
height: number;
}
type Dimension = {
width: number;
height: number;
}
type Point = {
x: number;
y: number;
}
type DisplayMetrics = 'bounds' | 'workArea' | 'scaleFactor' | 'rotation';
/**
@@ -2746,7 +2739,7 @@ declare namespace Electron {
/**
* @returns The display that most closely intersects the provided bounds.
*/
getDisplayMatching(rect: Bounds): Display;
getDisplayMatching(rect: Rectangle): Display;
}
// https://github.com/electron/electron/blob/master/docs/api/session.md
@@ -3318,17 +3311,17 @@ declare namespace Electron {
* Emitted when the tray icon is clicked.
* Note: The bounds payload is only implemented on macOS and Windows.
*/
on(event: 'click', listener: (modifiers: Modifiers, bounds: Bounds) => void): this;
on(event: 'click', listener: (modifiers: Modifiers, bounds: Rectangle) => void): this;
/**
* Emitted when the tray icon is right clicked.
* Note: This is only implemented on macOS and Windows.
*/
on(event: 'right-click', listener: (modifiers: Modifiers, bounds: Bounds) => void): this;
on(event: 'right-click', listener: (modifiers: Modifiers, bounds: Rectangle) => void): this;
/**
* Emitted when the tray icon is double clicked.
* Note: This is only implemented on macOS and Windows.
*/
on(event: 'double-click', listener: (modifiers: Modifiers, bounds: Bounds) => void): this;
on(event: 'double-click', listener: (modifiers: Modifiers, bounds: Rectangle) => void): this;
/**
* Emitted when the tray balloon shows.
* Note: This is only implemented on Windows.
@@ -3428,7 +3421,7 @@ declare namespace Electron {
/**
* @returns The bounds of this tray icon.
*/
getBounds(): Bounds;
getBounds(): Rectangle;
}
interface Modifiers {
@@ -3985,7 +3978,7 @@ declare namespace Electron {
* The dirtyRect is an object with x, y, width, height properties that describes which part of the page was repainted.
* If onlyDirty is set to true, frameBuffer will only contain the repainted area. onlyDirty defaults to false.
*/
dirtyRect?: Bounds
dirtyRect?: Rectangle
): void
}
@@ -4189,7 +4182,7 @@ declare namespace Electron {
* Specify page size of the generated PDF.
* Default: A4.
*/
pageSize?: 'A3' | 'A4' | 'A5' | 'Legal' | 'Letter' | 'Tabloid' | Dimension;
pageSize?: 'A3' | 'A4' | 'A5' | 'Legal' | 'Letter' | 'Tabloid' | Size;
/**
* Whether to print CSS backgrounds.
* Default: false.
@@ -4294,7 +4287,7 @@ declare namespace Electron {
/**
* Coordinates of first match region.
*/
selectionArea?: Bounds;
selectionArea?: Rectangle;
}
interface DeviceEmulationParameters {
@@ -4306,7 +4299,7 @@ declare namespace Electron {
/**
* Set the emulated screen size (screenPosition == mobile)
*/
screenSize?: Dimension;
screenSize?: Size;
/**
* Position the view on the screen (screenPosition == mobile)
* Default: {x: 0, y: 0}
@@ -4320,7 +4313,7 @@ declare namespace Electron {
/**
* Set the emulated view size (empty means no override).
*/
viewSize?: Dimension;
viewSize?: Size;
/**
* Whether emulated view should be scaled down if necessary to fit into available space
* Default: false
@@ -0,0 +1,18 @@
///<reference path="html-webpack-plugin.d.ts" />
import {Configuration} from "webpack";
import HtmlWebpackPlugin = require("html-webpack-plugin");
const a: Configuration = {
plugins: [
new HtmlWebpackPlugin()
]
};
const b: Configuration = {
plugins: [
new HtmlWebpackPlugin({
title: "test"
})
]
};
+89
View File
@@ -0,0 +1,89 @@
// Type definitions for html-webpack-plugin v2.22.2
// Project: https://github.com/ampedandwired/html-webpack-plugin
// Definitions by: Simon Hartcher <http://github.com/deevus>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
///<reference path="../webpack/webpack.d.ts" />
declare module "html-webpack-plugin" {
import {Plugin} from "webpack";
interface HtmlWebpackPluginConfiguration {
/**
* The title to use for the generated HTML document.
*/
title?: string;
/**
* The file to write the HTML to. Defaults to index.html. You can specify a subdirectory here too (eg: `assets/admin.html`).
*/
filename?: string;
/**
* Webpack require path to the template. Please see the docs for details.
*/
template?: string;
/**
* `true | 'head' | 'body' | false`
*
* Inject all assets into the given template or templateContent - When passing true or 'body' all javascript resources will be placed at the bottom of the body element. 'head' will place the scripts in the head element.
*/
inject?: boolean | "head" | "body";
/**
* Adds the given favicon path to the output html.
*/
favicon?: string;
/**
* Pass a html-minifier options object to minify the output.
*
* https://github.com/kangax/html-minifier#options-quick-reference
*/
minify?: any;
/**
* `true | false` if `true` then append a unique webpack compilation hash to all included scripts and css files. This is useful for cache busting.
*/
hash?: boolean;
/**
* `true | false` if `true` (default) try to emit the file only if it was changed.
*/
cache?: boolean;
/**
* `true | false` if `true` (default) errors details will be written into the html page.
*/
showErrors?: boolean;
/**
* Allows you to add only some chunks (e.g. only the unit-test chunk)
*/
chunks?: string[];
/**
* Allows to control how chunks should be sorted before they are included to the html. Allowed values: `'none' | 'auto' | 'dependency' | {function}` - default: `'auto'`
*/
chunksSortMode?: "none" | "auto" | "dependency" | Function;
/**
* Allows you to skip some chunks (e.g. don't add the unit-test chunk)
*/
excludeChunks?: string[];
/**
* `true | false` If `true` render the link tags as self-closing, XHTML compliant. Default is `false`
*/
xhtml?: boolean;
}
interface HtmlWebpackPlugin {
new (): Plugin;
new (options: HtmlWebpackPluginConfiguration): Plugin;
}
const htmlWebpackPlugin: HtmlWebpackPlugin;
export = htmlWebpackPlugin;
}
+376 -23
View File
@@ -4,44 +4,338 @@
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
///<reference types="jquery" />
// http://www.trirand.com/jqgridwiki/doku.php?id=wiki:colmodel_options
interface JQueryJqGridColumn {
name: string;
index: string;
/**
* Defines the alignment of the cell in the Body layer, not in header cell. Possible values: left, center, right
*/
align?: "left" | "center" | "right";
/**
* This function add attributes to the cell during the creation of the data - i.e dynamically.
* By example all valid attributes for the table cell can be used or a style attribute with different properties.
* @param rowId the id of the row
* @param val the value which will be added in the cell
* @param rowObject the raw object of the data row - i.e if datatype is json - array, if datatype is xml xml node.
* @param cm all the properties of this column listed in the colModel
* @param rdata the data row which will be inserted in the row. This parameter is array of type name:value, where name is the name in colModel
* @returns {}
*/
cellattr?: (rowId: any, val: any, rowObject: any, cm: any, rdata: any) => string;
/**
* This option allow to add classes to the column. If more than one class will be used a space should be set.
* By example classes:'class1 class2' will set a class1 and class2 to every cell on that column.
* In the grid css there is a predefined class ui-ellipsis which allow to attach ellipsis to a particular row.
* Also this will work in FireFox too.
*/
classes?: string;
/**
* Governs format of sorttype:date (when datetype is set to local) and editrules {date:true} fields.
* Determines the expected date format for that column. Uses a PHP-like date formatting. Currently "/", "-", and "." are supported as date separators. Valid formats are:
* y,Y,yyyy for four digits year
* YY, yy for two digits year
* m,mm for months
* d,dd for days.
*/
datefmt?: string;
/**
* Defines if the field is editable. This option is used in cell, inline and form modules.
*/
editable?: boolean;
/**
* The predefined types (string) or custom function name that controls the format of this field
* @param cellvalue is the value to be formatted
* @param options is an object containing the following element: rowId - is the id of the row colModel is the object of the properties for this column getted from colModel array of jqGrid
* @param rowObject is a row data represented in the format determined from datatype option. If we have datatype: xml/xmlstring - the rowObject is xml node,provided according to the rules from xmlReader If we have datatype: json/jsonstring - the rowObject is array, provided according to the rules from jsonReader
* @returns {} the formatted value
*/
formatter?: "integer" | "number" | "currency" | "date" | "email" | "link" | "showlink" | "checkbox" | "select" | "actions" | ((cellvalue: any, options: { rowId: any, colModel: any }, rowObject: any) => any);
/**
* Defines if this column is hidden at initialization.
*/
hidden?: boolean;
sortable?: boolean;
/**
* Set the index name when sorting. Passed as sidx parameter.
*/
index?: string;
/**
* Overwrite the id (defined in readers) from server. Can be set as id for the unique row id. Only one column can have this property.
* This option have higher priority as those from the readers.
* If there are more than one key set the grid finds the first one and the second is ignored.
*/
key?: boolean;
/**
* When colNames array is empty, defines the heading for this column.
* If both the colNames array and this setting are empty, the heading for this column comes from the name property.
*/
label?: string;
/**
* Set the unique name in the grid for the column.
* This property is required.
* As well as other words used as property/event names, the reserved words (which cannot be used for names) include subgrid, cb and rn.
*/
name: string;
/**
* When used in search modules, disables or enables searching on that column
*/
search?: boolean;
/**
* Defines is this can be sorted
*/
sortable?: boolean;
/**
* Set the initial width of the column, in pixels. This value currently can not be set as percentage
*/
width?: number;
formatter?: (cellvalue: any, options: any, rowObject: any) => any;
}
interface IJqGridJsonReader {
/**
* tells jqGrid that the information for the data in the row is repeatable - i.e. the elements have the same tag cell described in cell element. Setting this option to false instructs jqGrid to search elements in the json data by name.
* This is the name from colModel or the name described with the jsonmap option in colModel
*/
repeatitems: boolean;
root(obj: any): any;
page(obj: any): any;
total(obj: any): number;
records(obj: {data: any[]}): number;
/**
* Name of the root property
* @param obj
* @returns {}
*/
root: string | ((obj: any) => any);
/**
* current page of the query
* @param obj
* @returns {}
*/
page: string | ((obj: any) => number);
/**
* total pages for the query
* @param obj
* @returns {}
*/
total: string | ((obj: any) => number);
/**
* total number of records for the query
* @param obj
* @returns {}
*/
records: string | ((obj: {data: any[]}) => number);
}
interface JQueryJqGridOptions {
datatype?: string;
mtype?: string;
/**
* When set to true encodes (html encode) the incoming (from server) and posted data (from editing modules).
*/
autoencode?: boolean;
pager?: string;
rowNum?: number;
rowList?: number[];
colNames?: string[];
/**
* When set to true, the grid width is recalculated automatically to the width of the parent element.
* This is done only initially when the grid is created.
* In order to resize the grid when the parent element changes width you should apply custom code and use the setGridWidth method for this purpose
*/
autoWidth?: boolean;
/**
* Defines the caption for the grid. This caption appears in the caption layer, which is above the header layer
*/
caption?: string;
/**
* Array which describes the parameters of the columns. This is the most important part of the grid.
*/
colModel?: JQueryJqGridColumn[];
sortname?: string;
sortorder?: string;
multiselect?: boolean;
multiboxonly?: boolean;
/**
* An array in which we place the names of the columns.
* This is the text that appears in the head of the grid (header layer). The names are separated with commas.
* Note that the number of elements in this array should be equal of the number elements in the colModel array.
*/
colNames?: string[];
/**
* An array that stores the local data passed to the grid. You can directly point to this variable in case you want to load an array data.
* It can replace the addRowData method which is slow on relative big data
*/
data?: any[];
/**
* Defines in what format to expect the data that fills the grid.
* Valid options are xml (we expect data in xml format), xmlstring (we expect xml data as string), json (we expect data in JSON format),
* jsonstring (we expect JSON data as a string), local (we expect data defined at client side (array data)),
* javascript (we expect javascript as data), function (custom defined function for retrieving data),
* or clientSide to manually load data via the data array
*/
datatype?: "xml" | "xmlstring" | "json" | "jsonstring" | "local" | "javascript" | Function | "clientSide";
/**
* If set to true, and a column's width is changed, the adjacent column (to the right) will resize so that the overall grid width is maintained
* (e.g., reducing the width of column 2 by 30px will increase the size of column 3 by 30px). In this case there is no horizontal scrollbar.
* Note: This option is not compatible with shrinkToFit option - i.e if shrinkToFit is set to false, forceFit is ignored.
*/
forceFit?: boolean;
height?: number;
width?: number;
shrinkToFit?: boolean;
url?: string;
/**
* What will be the result if we insert all the data at once?
* Yes, this can be done with a help of gridview option (set it to true).
* The result is a grid that is 5 to 10 times faster. Of course, when this option is set to true we have some limitations.
* If set to true we can not use treeGrid, subGrid, or the afterInsertRow event.
* If you do not use these three options in the grid you can set this option to true and enjoy the speed.
*/
gridview?: boolean;
/**
* The height of the grid.
* Can be set as number (in this case we mean pixels) or as percentage (only 100% is accepted) or value of auto is acceptable.
*/
height?: number | string | "auto";
/**
* If this flag is set to true, the grid loads the data from the server only once (using the appropriate datatype).
* After the first request, the datatype parameter is automatically changed to local and all further manipulations are done on the client side.
* The functions of the pager (if present) are disabled.
*/
loadonce?: boolean;
/**
* An array which describes the structure of the expected json data.
*/
jsonReader?: IJqGridJsonReader;
gridComplete?:()=>void;
/**
* Defines the type of request to make ("POST" or "GET")
*/
mtype?: "GET" | "POST";
/**
* This option works only when the multiselect option is set to true.
* When multiselect is set to true, clicking anywhere on a row selects that row;
* when multiboxonly is also set to true, the multiselection is done only when the checkbox is clicked (Yahoo style).
* Clicking in any other row (suppose the checkbox is not clicked) deselects all rows and selects the current row.
*/
multiboxonly?: boolean;
/**
* If this flag is set to true a multi selection of rows is enabled. A new column at left side containing checkboxes is added.
* Can be used with any datatype option
*/
multiselect?: boolean;
/**
* Defines that we want to use a pager bar to navigate through the records.
* This must be a valid HTML element; in our example we gave the div the id of "pager", but any name is acceptable.
* Note that the navigation layer (the "pager" div) can be positioned anywhere you want, determined by your HTML;
* in our example we specified that the pager will appear after the body layer.
* The valid settings can be (in the context of our example) pager, #pager, jQuery('#pager').
* I recommend to use the second one - #pager
*/
pager?: string;
/**
* An array to construct a select box element in the pager in which we can change the number of the visible rows.
* When changed during the execution, this parameter replaces the rowNum parameter that is passed to the url.
* If the array is empty, this element does not appear in the pager. Typically you can set this like [10,20,30].
* If the rowNum parameter is set to 30 then the selected value in the select box is 30
*/
rowList?: number[];
/**
* Sets how many records we want to view in the grid. This parameter is passed to the url for use by the server routine retrieving the data.
* Note that if you set this parameter to 10 (i.e. retrieve 10 records) and your server return 15 then only 10 records will be loaded
*/
rowNum?: number;
/**
* This option, if set, defines how the the width of the columns of the grid should be re-calculated, taking into consideration the width of the grid.
* If this value is true, and the width of the columns is also set, then every column is scaled in proportion to its width.
* For example, if we define two columns with widths 80 and 120 pixels, but want the grid to have a width of 300 pixels,
* then the columns will stretch to fit the entire grid, and the extra width assigned to them will depend on the width of the columns themselves and the extra width available.
* The re-calculation is done as follows: the first column gets the width (300(new width)/200(sum of all widths))*80(first column width) = 120 pixels,
* and the second column gets the width (300(new width)/200(sum of all widths))*120(second column width) = 180 pixels.
* Now the widths of the columns sum up to 300 pixels, which is the width of the grid.
* If the value is false and the value in width option is set, then no re-sizing happens whatsoever.
* So in this example, if shrinkToFit is set to false, column one will have a width of 80 pixels,
* column two will have a width of 120 pixels and the grid will retain the width of 300 pixels.
* If the value of shrinkToFit is an integer, the width is calculated according to it.
*/
shrinkToFit?: boolean | number;
/**
* The column according to which the data is to be sorted when it is initially loaded from the server
* (note that you will have to use datatypes xml or json to load remote data). This parameter is appended to the url.
* If this value is set and the index (name) matches the name from colModel,
* then an icon indicating that the grid is sorted according to this column is added to the column header.
* This icon also indicates the sorting order - descending or ascending (see the parameter sortorder). Also see prmNames
*/
sortname?: string;
/**
* The initial sorting order (ascending or descending) when we fetch data from the server using datatypes xml or json.
* This parameter is appended to the url - see prnNames. The two allowed values are - asc or desc.
*/
sortorder?: "asc" | "desc";
/**
* The url of the file that returns the data needed to populate the grid. May be set to clientArray to manualy post data to server
*/
url?: string | "clientArray";
/**
* If true, jqGrid displays the beginning and ending record number in the grid, out of the total number of records in the query.
* This information is shown in the pager bar (bottom right by default)in this format: "View X to Y out of Z".
* If this value is true, there are other parameters that can be adjusted, including emptyrecords and recordtext.
*/
viewrecords?: boolean;
/**
* If this option is not set, the width of the grid is the sum of the widths of the columns defined in the colModel (in pixels).
* If this option is set, the initial width of each column is set according to the value of the shrinkToFit option.
*/
width?: number;
// events
/**
* This fires after all the data is loaded into the grid and all other processes are complete.
* Also the event fires independent from the datatype parameter and after sorting paging and etc.
* @returns {}
*/
gridComplete?: () => void;
/**
* Raised immediately after row was right clicked
* @param rowid is the id of the row
* @param iRow is the index of the row (do not mix this with the rowid)
* @param iCol is the index of the cell
* @param e is the event object
* @returns {}
*/
onRightClickRow?: (rowid: any, iRow: number, iCol: number, e: Event) => void;
/**
* Raised immediately after row was clicked.
* @param id is the id of the row
* @param status is the status of the selection
* @param e is the event object. Can be used when multiselect is set to true. true if the row is selected, false if the row is deselected.
* @returns {}
*/
onSelectRow?: (id: string, status: any, e: Event) => void;
}
interface JQueryJqGridStatic {
@@ -60,5 +354,64 @@ interface JQueryStatic {
interface JQuery {
jqGrid?: JQueryJqGridStatic;
/**
* Populates a grid with the passed data (an array)
* @param data
* @returns {}
*/
addJSONData(data: any[]): void;
/**
* Edits the row specified by rowid.
* keys is a boolean value, indicating if to use the Enter key to accept the value ane Esc to cancel the edit, or not.
* @param rowid the id of the row to edit
* @param keys when set to true we can use [Enter] key to save the row and [Esc] to cancel editing
* @returns {}
*/
editRow(rowid: any, keys?: boolean): void;
/**
* Returns the value of the requested parameter. name is the name from the options array. If the name is not set, the entry options are returned.
* @param name
* @returns {}
*/
getGridParam(name: string): any;
/**
* This method restores the data to original values before the editing of the row
* @param rowId the row to restore
* @param afterRestoreFunc if defined this function is called in after the row is restored.
* @returns {}
*/
restoreRow(rowId: any, afterRestoreFunc?: (response: any) => void): void;
/**
* Saves the edited row.
* @param rowid the id of the row to save
* @param successfunc
* @param url if defined, this parameter replaces the editurl parameter from the options array. If set to 'clientArray', the data is not posted to the server but rather is saved only to the grid (presumably for later manual saving).
* @param extraparam an array of type name: value. When set these values are posted along with the other values to the server.
* @returns {}
*/
saveRow(rowid: string, successfunc?: (response: any) => boolean, url?: string, extraparam?: any): void;
/**
* Saves the edited row.
* @param rowid the id of the row to save
* @param successfunc
* @param url
* @param extraparam
* @returns {}
*/
saveRow(rowid: string, successfunc?: boolean, url?: string, extraparam?: any): void;
/**
* Sets a particular parameter.
* Note - for some parameters to take effect a trigger("reloadGrid") should be executed.
* Note that with this method we can override events.
* The name (in the name:value pair) is the name from options array
* @param obj
* @returns {}
*/
setGridParam(obj: any): void;
}
+20
View File
@@ -3,3 +3,23 @@
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
///<reference types="jquery" />
var mydata: any[] = [];
$('#jqGrid')
.jqGrid({
datatype: 'local',
data: mydata,
loadonce: true,
gridview: true,
height: 400,
shrinkToFit: true,
width: null,
colModel: [
{ label: 'Name', name: 'id', width: 75, key: true, align: 'left' },
{ label: 'Description', name: 'description', width: 100 }
],
viewrecords: true, // show the current page, data rang and total records on the toolbar
caption: 'Matches',
onSelectRow(id: any, status: any, e: Event) { }
});
+225
View File
@@ -0,0 +1,225 @@
/// <reference path="./json-merge-patch.d.ts" />
import * as jmp from "json-merge-patch";
var merge = jmp.merge;
var apply = jmp.apply;
var generate = jmp.generate;
var assert = {deepEqual: function (a: Object, b: Object) {
return JSON.stringify(a) === JSON.stringify(b);
}};
assert.deepEqual(
merge({a: 'b'}, {b: 'c'}),
{a: 'b', b: 'c'}
);
assert.deepEqual(
merge({a: 'b'}, {a: 'c'}),
{a: 'c'}
);
assert.deepEqual(
merge({a: 'b', b: 'd'}, {a: 'c'}),
{a: 'c', b: 'd'}
);
assert.deepEqual(
merge({a: null}, {b: 'c'}),
{a: null, b: 'c'}
);
assert.deepEqual(
merge({a: null}, {a: 'b'}),
{a: 'b'}
);
assert.deepEqual(
merge({a: 'b'}, {a: null}),
{a: null}
);
assert.deepEqual(
merge([], {a: 'b'}),
{a: 'b'}
);
assert.deepEqual(
merge({a: 'b'}, []),
[]
);
assert.deepEqual(
merge({a: {b: {c: 'd'}}, d: 'e'}, {a: {b: 'a'}}),
{a: {b: 'a'}, d: 'e'}
);
assert.deepEqual(
merge({a: {b: {c: 'd'}, d: 'e'}}, {a: {b: {c: 'e'}}}),
{a: {b: {c: 'e'}, d: 'e'}}
);
assert.deepEqual(
merge({a: 'b'}, null),
null
);
assert.deepEqual(
generate({a: 'b'}, {a: 'c'}),
{a: 'c'}
);
assert.deepEqual(
generate({a: 'b'}, { a: 'b', b: 'c'}),
{b: 'c'}
);
assert.deepEqual(
generate({a: 'b'}, {}),
{a: null}
);
assert.deepEqual(
generate({a: 'b', b: 'c'}, {b: 'c'}),
{a: null}
);
assert.deepEqual(
generate({a: ['b']}, {a: 'c'}),
{a: 'c'}
);
assert.deepEqual(
generate({a: 'c'}, {a: ['b']}),
{a: ['b']}
);
assert.deepEqual(
generate({a: [{b: 'c'}]}, {a: [1]}),
{a: [1]}
);
assert.deepEqual(
generate(['a', 'b'], ['c', 'd']),
['c', 'd']
);
assert.deepEqual(
generate(['a', 'b'], ['a']),
['a']
);
assert.deepEqual(
generate({a: 'b'}, ['c']),
['c']
);
assert.deepEqual(
generate({a: 'foo'}, null),
null
);
assert.deepEqual(
generate({a: 'foo'}, 'bar'),
'bar'
);
assert.deepEqual(
generate({e: null}, {e: null, a: 1}),
{a: 1}
);
assert.deepEqual(
generate({}, {a: {bb: {}}}),
{a: {bb: {}}}
);
assert.deepEqual(
generate({a: 'a'}, {a: 'a'}),
undefined
);
assert.deepEqual(
generate({a: {b: 'c'}}, {a: {b: 'c'}}),
undefined
);
assert.deepEqual(
generate([1,2,3], [1,2,3]),
undefined
);
assert.deepEqual(
apply({a: 'b'}, {a: 'c'}),
{a: 'c'}
);
assert.deepEqual(
apply({a: 'b'}, {b: 'c'}),
{a: 'b', b: 'c'}
);
assert.deepEqual(
apply({a: 'b'}, {a: null}),
{}
);
assert.deepEqual(
apply({a: 'b', b: 'c'}, {a: null}),
{b: 'c'}
);
assert.deepEqual(
apply({a: ['b']}, {a: 'c'}),
{a: 'c'}
);
assert.deepEqual(
apply({a: 'c'}, {a: ['b']}),
{a: ['b']}
);
assert.deepEqual(
apply({a: {b: 'c'}}, {a: {b: 'd', c: null}}),
{a: {b: 'd'}}
);
assert.deepEqual(
apply({a: [{b: 'c'}]}, {a: [1]}),
{a: [1]}
);
assert.deepEqual(
apply(['a', 'b'], ['c', 'd']),
['c', 'd']
);
assert.deepEqual(
apply({a: 'b'}, ['c']),
['c']
);
assert.deepEqual(
apply({a: 'foo'}, null),
null
);
assert.deepEqual(
apply({a: 'foo'}, 'bar'),
'bar'
);
assert.deepEqual(
apply({e: null}, {a: 1}),
{e: null, a: 1}
);
assert.deepEqual(
apply([1, 2], {a: 'b', c: null}),
{a: 'b'}
);
assert.deepEqual(
apply({}, {a: {bb: {ccc: null}}}),
{a: {bb: {}}}
);
+11
View File
@@ -0,0 +1,11 @@
// Type definitions for json-merge-patch
// Project: https://github.com/pierreinglebert/json-merge-patch
// Definitions by: Arsenij Schuetzer <https://github.com/senyaarseniy>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare module "json-merge-patch" {
function apply(target: Object, patch: Object): Object;
function generate(before: Object, after: Object): Object;
function merge(patch1: Object, patch2: Object): Object;
}
+1 -1
View File
@@ -1,4 +1,4 @@
// Type definitions for Lo-Dash
// Type definitions for Lo-Dash 4.14
// Project: http://lodash.com/
// Definitions by: Brian Zengel <https://github.com/bczengel>, Ilya Mochalov <https://github.com/chrootsu>, Stepan Mikhaylyuk <https://github.com/stepancar>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+1 -1
View File
@@ -1,4 +1,4 @@
// Type definitions for Lo-Dash
// Type definitions for Lo-Dash 3.10
// Project: http://lodash.com/
// Definitions by: Brian Zengel <https://github.com/bczengel>, Ilya Mochalov <https://github.com/chrootsu>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+95
View File
@@ -0,0 +1,95 @@
/// <reference path="mainloop.js.d.ts" />
// To see what this test does, create an HTML file with these contents and open it:
/*
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>MainLoop.js test</title>
<meta name="description" content="TypeScript typings test for MainLoop.js.">
<style>
html, body { height: 100%; margin: 0; overflow: hidden; position: relative; }
</style>
</head>
<body>
<script src="https://rawgit.com/IceCreamYou/MainLoop.js/gh-pages/build/mainloop.min.js"></script>
<script src="mainloop.js-tests.js"></script>
</body>
</html>
*/
window.addEventListener('load', () => {
let cx = window.innerWidth / 2 - 15,
cy = window.innerHeight / 2 - 15,
x = cx + 120,
y = cy,
lx = x,
ly = y,
theta = 0
const radius = 120,
velocity = 0.1 * Math.PI / 180;
const actor = document.createElement('div');
actor.style.width = '30px';
actor.style.height = '30px';
actor.style.backgroundColor = 'red';
actor.style.position = 'absolute';
actor.style.left = x + 'px';
actor.style.top = y + 'px';
document.body.appendChild(actor);
const fpsCounter = document.createElement('div');
fpsCounter.style.position = 'absolute';
fpsCounter.style.left = '10px';
fpsCounter.style.top = '10px';
document.body.appendChild(fpsCounter);
document.body.addEventListener('click', (event) => {
cx = event.pageX;
cy = event.pageY;
});
MainLoop
.setBegin((timestamp, delta) => {
lx = x;
ly = y;
x = cx + Math.cos(theta) * radius;
y = cy + Math.sin(theta) * radius;
})
.setDraw((interpolationPercentage) => {
actor.style.left = (lx + (x - lx) * interpolationPercentage) + 'px';
actor.style.top = (ly + (y - ly) * interpolationPercentage) + 'px';
})
.setUpdate((delta) => {
theta += velocity * delta;
})
.setEnd((fps, panic) => {
fpsCounter.textContent = Math.round(fps) + ' FPS';
if (panic) {
console.info(
`Main loop panicked; tried to simulate too much time. Discarding ${MainLoop.resetFrameDelta()}ms`
);
}
})
.start();
document.body.addEventListener('keyup', (event) => {
if ((event.which || event.keyCode) === 80) { // Hit P to toggle Pause
if (MainLoop.isRunning()) {
MainLoop.stop();
}
else {
MainLoop.start();
}
}
});
});
+28
View File
@@ -0,0 +1,28 @@
// Type definitions for MainLoop.js v1.0.3
// Project: https://github.com/IceCreamYou/MainLoop.js
// Definitions by: Isaac Sukin <http://isaacsukin.com>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/**
* Interface for the MainLoop.js global.
*
* See the API documentation for a detailed explanation of these methods:
* http://icecreamyou.github.com/MainLoop.js/docs/#!/api/MainLoop
*/
interface MainLoop {
getFPS(): number;
getMaxAllowedFPS(): number;
getSimulationTimestep(): number;
isRunning(): boolean;
resetFrameDelta(): number;
setBegin(begin: (timestamp: number, delta: number) => void): MainLoop;
setDraw(draw: (interpolationPercentage: number) => void): MainLoop;
setUpdate(update: (delta: number) => void): MainLoop;
setEnd(end: (fps: number, panic: boolean) => void): MainLoop;
setMaxAllowedFPS(fps?: number): MainLoop;
setSimulationTimestep(timestep: number): MainLoop;
start(): MainLoop;
stop(): MainLoop;
}
declare var MainLoop: MainLoop;
+13
View File
@@ -80,6 +80,19 @@ declare class BayesClassifier {
static restore(classifier: any, stemmer?: Stemmer): BayesClassifier;
}
interface LogisticRegressionClassifierCallback { (err: any, classifier: any): void }
declare class LogisticRegressionClassifier {
events: events.EventEmitter;
addDocument(text: string, stem: string): void;
addDocument(text: string[], stem: string): void;
train(): void;
classify(observation: string): string;
getClassifications(observation: string): string[];
save(filename: string, callback: LogisticRegressionClassifierCallback): void;
static load(filename: string, stemmer: Stemmer, callback: LogisticRegressionClassifierCallback): void;
static restore(classifier: any, stemmer?: Stemmer): LogisticRegressionClassifier;
}
interface Phonetic {
compare(stringA: string, stringB: string): boolean;
process(token: string, maxLength?: number): string;
+3
View File
@@ -9,6 +9,9 @@ device.busNumber = 1;
device.deviceAddress = 1;
device.portNumbers = [1, 2, 3];
device.__open();
device.__claimInterface(0);
device.open(true);
device.close();
const xferDevice: usb.Device = device.controlTransfer(1, 1, 1, 1, 1, (error: string, buf: Buffer): usb.Device => new usb.Device());
+3
View File
@@ -16,6 +16,9 @@ declare module "usb" {
public configDescriptor: ConfigDescriptor;
public interfaces: Array<Interface>;
__open(): void;
__claimInterface(addr: number): void;
open(defaultConfig?: boolean): void;
close(): void;
interface(addr: number): Interface;
+9
View File
@@ -627,6 +627,7 @@ declare module "http" {
removeHeader(name: string): void;
write(chunk: any, encoding?: string): any;
addTrailers(headers: any): void;
finished: boolean;
// Extended base methods
end(): void;
@@ -938,6 +939,14 @@ declare module "https" {
export interface Agent extends http.Agent { }
export interface AgentOptions extends http.AgentOptions {
pfx?: any;
key?: any;
passphrase?: string;
cert?: any;
ca?: any;
ciphers?: string;
rejectUnauthorized?: boolean;
secureProtocol?: string;
maxCachedSessions?: number;
}
+8
View File
@@ -885,6 +885,14 @@ declare module "https" {
export interface Agent extends http.Agent { }
export interface AgentOptions extends http.AgentOptions {
pfx?: any;
key?: any;
passphrase?: string;
cert?: any;
ca?: any;
ciphers?: string;
rejectUnauthorized?: boolean;
secureProtocol?: string;
maxCachedSessions?: number;
}
+1
View File
@@ -35,6 +35,7 @@ declare namespace Nunjucks {
function configure(options: ConfigureOptions): Environment;
function configure(path: string, options?: ConfigureOptions): Environment;
function configure(path: string[], options?: ConfigureOptions): Environment;
interface ConfigureOptions {
autoescape?: boolean;
+24 -18
View File
@@ -8,7 +8,7 @@ declare namespace olx {
/** Attributions */
attributions?: Array<ol.Attribution>
/*** The crossOrigin attribute for loaded images. Note that you must provide a crossOrigin value if you are using the WebGL renderer or if you want to access pixel data with the Canvas renderer. See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail. */
crossOrigin?: string
@@ -47,7 +47,7 @@ declare namespace olx {
/*** The extent to zoom to. If undefined the validity extent of the view projection is used.*/
extent: ol.Extent;
}
interface AttributionOptions {
/** HTML markup for this attribution. */
@@ -1220,7 +1220,7 @@ declare namespace ol {
/**
* Events emitted by ol.Collection instances are instances of this type.
*/
class CollectionEvent<T> {
class CollectionEvent<T> extends ol.events.Event {
/**
* The element that is added to or removed from the collection.
@@ -1279,7 +1279,7 @@ declare namespace ol {
/**
* Events emitted by ol.interaction.DragBox instances are instances of this type.
*/
class DragBoxEvent {
class DragBoxEvent extends ol.events.Event {
/**
* The coordinate of the drag event.
@@ -1935,7 +1935,7 @@ declare namespace ol {
/**
* Events emitted as map events are instances of this type. See ol.Map for which events trigger a map event.
*/
class MapEvent {
class MapEvent extends ol.events.Event {
/**
* The frame state at the time of the event.
@@ -2005,7 +2005,7 @@ declare namespace ol {
/**
* Events emitted by ol.Object instances are instances of this type.
*/
class ObjectEvent {
class ObjectEvent extends ol.events.Event {
/**
* The name of the property whose value is changing.
@@ -2045,7 +2045,7 @@ declare namespace ol {
* @param ref The object to use as this in listener.
* @returns Unique key for the listener.
*/
on(type: string, listener: (event: MapBrowserEvent) => void, ref?: any): any;
on(type: string, listener: (event: ol.events.Event) => void, ref?: any): any;
/**
* Listen for a certain type of event.
@@ -2054,7 +2054,7 @@ declare namespace ol {
* @param ref The object to use as this in listener.
* @returns Unique key for the listener.
*/
on(type: Array<string>, listener: (event: MapBrowserEvent) => void, ref?: any): any;
on(type: Array<string>, listener: (event: ol.events.Event) => void, ref?: any): any;
/**
* Listen once for a certain type of event.
@@ -2063,7 +2063,7 @@ declare namespace ol {
* @param ref The object to use as this in listener.
* @returns Unique key for the listener.
*/
once(type: string, listener: (event: MapBrowserEvent) => void, ref?: any): any;
once(type: string, listener: (event: ol.events.Event) => void, ref?: any): any;
/**
* Listen once for a certain type of event.
@@ -2072,7 +2072,7 @@ declare namespace ol {
* @param ref The object to use as this in listener.
* @returns Unique key for the listener.
*/
once(type: Array<string>, listener: (event: MapBrowserEvent) => void, ref?: any): any;
once(type: Array<string>, listener: (event: ol.events.Event) => void, ref?: any): any;
/**
* Unlisten for a certain type of event.
@@ -2081,7 +2081,7 @@ declare namespace ol {
* @param ref The object to use as this in listener.
* @returns Unique key for the listener.
*/
un(type: Array<string>, listener: (event: MapBrowserEvent) => void, ref?: any): any;
un(type: Array<string>, listener: (event: ol.events.Event) => void, ref?: any): any;
/**
* Removes an event listener using the key returned by on() or once(). Note that using the ol.Observable.unByKey static function is to be preferred.
@@ -2165,7 +2165,7 @@ declare namespace ol {
/**
* Events emitted by ol.interaction.Select instances are instances of this type.
*/
class SelectEvent {
class SelectEvent extends ol.events.Event {
/**
* Deselected features array.
@@ -2551,6 +2551,12 @@ declare namespace ol {
function targetNotEditable(mapBrowserEvent: ol.MapBrowserEvent): boolean;
}
interface ConditionType { (mapBrowseEvent: ol.MapBrowserEvent): boolean; }
class Event {
target: any;
type: string;
preventDefault(): void;
stopPropagation(): void;
}
}
namespace extent {
@@ -3601,7 +3607,7 @@ declare namespace ol {
class DragAndDrop {
}
class DragAndDropEvent {
class DragAndDropEvent extends ol.events.Event {
}
class DragBox {
@@ -3623,7 +3629,7 @@ declare namespace ol {
constructor(opt_options?: olx.interaction.DrawOptions)
}
class DrawEvent {
class DrawEvent extends ol.events.Event {
}
class Interaction extends ol.Object {
@@ -4129,7 +4135,7 @@ declare namespace ol {
namespace render {
class Event {
class Event extends ol.events.Event {
}
class VectorContext {
@@ -4167,7 +4173,7 @@ declare namespace ol {
class ImageCanvas extends Image {
}
class ImageEvent {
class ImageEvent extends ol.events.Event {
}
class ImageMapGuide extends Image {
@@ -4216,7 +4222,7 @@ declare namespace ol {
class TileDebug extends Tile {
}
class TileEvent {
class TileEvent extends ol.events.Event {
}
class TileImage extends UrlTile {
@@ -4301,7 +4307,7 @@ declare namespace ol {
getFeaturesAtCoordinate(coordinate: ol.Coordinate): ol.Feature[];
}
class VectorEvent {
class VectorEvent extends ol.events.Event {
}
class VectorTile extends UrlTile {
+1 -1
View File
@@ -1,4 +1,4 @@
/// <reference types="node" />
/// <reference types="oracledb" />
import * as OracleDB from 'oracledb';
+39 -1
View File
@@ -3428,7 +3428,6 @@ declare module "react" {
*/
resetTo( route: Route ): void;
}
namespace NavigatorStatic {
@@ -4658,6 +4657,8 @@ declare module "react" {
* assets-library tag
* a tag not maching any of the above, which means the image data will be stored in memory (and consume memory as long as the process is alive)
*
* @deprecated use saveToCameraRoll instead
*
*/
saveImageWithTag(tag: string): Promise<string>
@@ -4677,6 +4678,22 @@ declare module "react" {
*/
saveToCameraRoll(tag: string, type?: 'photo' | 'video'): Promise<string>
/**
* Saves the photo or video to the camera roll / gallery.
*
* On Android, the tag must be a local image or video URI, such as `"file:///sdcard/img.png"`.
*
* On iOS, the tag can be any image URI (including local, remote asset-library and base64 data URIs)
* or a local video file URI (remote or data URIs are not supported for saving video at this time).
*
* If the tag has a file extension of .mov or .mp4, it will be inferred as a video. Otherwise
* it will be treated as a photo. To override the automatic choice, you can pass an optional
* `type` parameter that must be one of 'photo' or 'video'.
*
* Returns a Promise which will resolve with the new URI.
*/
saveToCameraRoll(tag: string, type?: 'photo' | 'video'): Promise<string>
/**
* Invokes callback with photo identifier objects from the local camera roll of the device matching shape defined by getPhotosReturnChecker.
*
@@ -5859,6 +5876,27 @@ declare module "react" {
addListener(event: string, handler: (data: any) => void): NativeEventSubscription;
}
//
// Interfacing with Native Modules
// https://facebook.github.io/react-native/docs/native-modules-ios.html
//
export interface NativeEventSubscription {
/**
* Call this method to un-subscribe from a native-event
*/
remove(): void;
}
/**
* Receive events from native-code
* @see https://facebook.github.io/react-native/docs/native-modules-ios.html#sending-events-to-javascript
*/
export interface NativeAppEventEmitterStatic {
addListener(event: string, handler: (data: any) => void): NativeEventSubscription;
}
//////////////////////////////////////////////////////////////////////////
//
// R E - E X P O R T S
+1 -1
View File
@@ -304,7 +304,7 @@ declare namespace ReactSelectClass {
/**
* initial field value
*/
value?: Option | Option[];
value?: Option | Option[] | string | string[] | number | number[];
/**
* the option property to use for the value
* @default "value"
+19
View File
@@ -137,6 +137,25 @@ class SelectTest extends React.Component<React.Props<{}>, {}> {
}
}
class SelectWithStringValueTest extends React.Component<React.Props<{}>, {}> {
render() {
const options: Option[] = [{ label: "Foo", value: "bar" }];
const onChange = (value: any) => console.log(value);
const selectProps: ReactSelectProps = {
name: "test-select-with-string-value",
value: "bar",
options: options,
onChange: onChange
};
return <div>
<Select {...selectProps} />
</div>;
}
}
class SelectAsyncTest extends React.Component<React.Props<{}>, {}> {
render() {
+3 -1
View File
@@ -17,7 +17,9 @@ declare namespace ReactTabs {
onSelect?: (index: number, last: number) => void;
}
interface Tabs extends React.ComponentClass<TabsProps> {}
interface Tabs extends React.ComponentClass<TabsProps> {
setUseDefaultStyles: (use: boolean) => void;
}
interface TabListProps {
className?: string;
+14
View File
@@ -182,6 +182,8 @@ declare namespace React {
};
}
class PureComponent<P, S> extends Component<P, S> {}
interface ClassicComponent<P, S> extends Component<P, S> {
replaceState(nextState: S, callback?: () => any): void;
isMounted(): boolean;
@@ -2471,6 +2473,7 @@ declare global {
circle: React.SVGProps;
clipPath: React.SVGProps;
defs: React.SVGProps;
desc: React.SVGProps;
ellipse: React.SVGProps;
feBlend: React.SVGProps;
feColorMatrix: React.SVGProps;
@@ -2479,14 +2482,21 @@ declare global {
feConvolveMatrix: React.SVGProps;
feDiffuseLighting: React.SVGProps;
feDisplacementMap: React.SVGProps;
feDistantLight: React.SVGProps;
feFlood: React.SVGProps;
feFuncA: React.SVGProps;
feFuncB: React.SVGProps;
feFuncG: React.SVGProps;
feFuncR: React.SVGProps;
feGaussianBlur: React.SVGProps;
feImage: React.SVGProps;
feMerge: React.SVGProps;
feMergeNode: React.SVGProps;
feMorphology: React.SVGProps;
feOffset: React.SVGProps;
fePointLight: React.SVGProps;
feSpecularLighting: React.SVGProps;
feSpotLight: React.SVGProps;
feTile: React.SVGProps;
feTurbulence: React.SVGProps;
filter: React.SVGProps;
@@ -2497,6 +2507,7 @@ declare global {
linearGradient: React.SVGProps;
marker: React.SVGProps;
mask: React.SVGProps;
metadata: React.SVGProps;
path: React.SVGProps;
pattern: React.SVGProps;
polygon: React.SVGProps;
@@ -2504,10 +2515,13 @@ declare global {
radialGradient: React.SVGProps;
rect: React.SVGProps;
stop: React.SVGProps;
switch: React.SVGProps;
symbol: React.SVGProps;
text: React.SVGProps;
textPath: React.SVGProps;
tspan: React.SVGProps;
use: React.SVGProps;
view: React.SVGProps;
}
}
}
+2 -2
View File
@@ -134,11 +134,11 @@ declare namespace rosie {
* Factory.define('Person').sequence('id');
*
* @param {string} attr
* @param {Array.<string>=} dependencies
* @param {Array.<string>=} | Function dependencies or builder
* @param {function(number): *=} builder
* @return {Factory}
*/
sequence(name: string, dependencies?: string[], builder?: Function) : IFactory;
sequence(name: string, dependenciesOrBuilder?: Function | string[], builder?: Function) : IFactory;
/**
* Sets a post-processor callback that will receive built objects and the
+9 -1
View File
@@ -1,4 +1,4 @@
// Type definitions for semver v4.3.4
// Type definitions for semver v5.3.0
// Project: https://github.com/npm/node-semver
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/semver
@@ -28,6 +28,10 @@ declare namespace SemVerModule {
* Return the patch version number.
*/
function patch(v: string, loose?: boolean): number;
/**
* Returns an array of prerelease components, or null if none exist.
*/
function prerelease(v: string, loose?: boolean): string[];
// Comparison
/**
@@ -84,6 +88,10 @@ declare namespace SemVerModule {
* Return the highest version in the list that satisfies the range, or null if none of them do.
*/
function maxSatisfying(versions: string[], range: string, loose?: boolean): string;
/**
* Return the lowest version in the list that satisfies the range, or null if none of them do.
*/
function minSatisfying(versions: string[], range: string, loose?: boolean): string;
/**
* Return true if version is greater than all the versions possible in the range.
*/
+2
View File
@@ -27,6 +27,7 @@ str = mod.inc(str, str, loose);
num = mod.major(str, loose);
num = mod.minor(str, loose);
num = mod.patch(str, loose);
strArr = mod.prerelease(str, loose);
// Comparison
bool = mod.gt(v1, v2, loose);
@@ -44,6 +45,7 @@ diff = mod.diff(v1, v2, loose);
str = mod.validRange(str, loose);
bool = mod.satisfies(version, str, loose);
str = mod.maxSatisfying(versions, str, loose);
str = mod.minSatisfying(versions, str, loose);
bool = mod.gtr(version, str, loose);
bool = mod.ltr(version, str, loose);
bool = mod.outside(version, str, str, loose);
+3 -3
View File
@@ -4995,17 +4995,17 @@ declare namespace sequelize {
/**
* Maximum connections of the pool
*/
maxConnections?: number;
max?: number;
/**
* Minimum connections of the pool
*/
minConnections?: number;
min?: number;
/**
* The maximum time, in milliseconds, that a connection can be idle before being released.
*/
maxIdleTime?: number;
idle?: number;
/**
* A function that validates a connection. Called with client. The default function checks that client is an
+114
View File
@@ -0,0 +1,114 @@
/// <reference path="spectacle.d.ts" />
/// <reference path="../react/react-global.d.ts" />
/**
* Spectacle Test Examples
*
*/
import * as React from 'react';
import {
Appear,
BlockQuote,
Cite,
Deck,
Fill,
Heading,
Layout,
Link,
ListItem,
List,
Quote,
Slide,
Spectacle,
Text
} from "spectacle";
export class SpectacleTest extends React.Component<any, any> {
callback() {
alert('Callback: ' + JSON.stringify(arguments));
}
public render() {
return (<Spectacle>
<Deck transition={["zoom", "slide"]} transitionDuration={500}>
<Slide transition={["zoom"]} bgColor="primary">
<Heading size={1} fit caps lineHeight={1} textColor="black">
Spectacle
</Heading>
<Heading size={1} fit caps>
A ReactJS Presentation Library
</Heading>
<Heading size={1} fit caps textColor="black">
Where You Can Write Your Decks In JSX
</Heading>
<Link href="https://github.com/FormidableLabs/spectacle">
<Text bold caps textColor="tertiary">View on Github</Text>
</Link>
<Text textSize="1.5em" margin="20px 0px 0px" bold>Hit Your Right Arrow To Begin!</Text>
</Slide>
<Slide transition={["slide"]} bgColor="black" notes="You can even put notes on your slide. How awesome is that?">
<Heading size={2} caps fit textColor="primary" textFont="primary">
Wait what?
</Heading>
</Slide>
<Slide transition={["slide"]} bgDarken={0.75}>
<Appear fid="1">
<Heading size={1} caps fit textColor="primary">
Full Width
</Heading>
</Appear>
<Appear fid="2">
<Heading size={1} caps fit textColor="tertiary">
Adjustable Darkness
</Heading>
</Appear>
<Appear fid="3">
<Heading size={1} caps fit textColor="primary">
Background Imagery
</Heading>
</Appear>
</Slide>
<Slide transition={["zoom", "fade"]} bgColor="primary">
<Heading caps fit>Flexible Layouts</Heading>
<Layout>
<Fill>
<Heading size={4} caps textColor="secondary" bgColor="white" margin={10}>
Left
</Heading>
</Fill>
<Fill>
<Heading size={4} caps textColor="secondary" bgColor="white" margin={10}>
Right
</Heading>
</Fill>
</Layout>
</Slide>
<Slide transition={["slide"]} bgColor="black">
<BlockQuote>
<Quote>Wonderfully formatted quotes</Quote>
<Cite>Ken Wheeler</Cite>
</BlockQuote>
</Slide>
<Slide transition={["slide", "spin"]} bgColor="primary">
<Heading caps fit size={1} textColor="tertiary">
Smooth
</Heading>
<Heading caps fit size={1} textColor="secondary">
Combinable Transitions
</Heading>
</Slide>
<Slide transition={["fade"]} bgColor="secondary" textColor="primary">
<List>
<Appear><ListItem>Inline style based theme system</ListItem></Appear>
<Appear><ListItem>Autofit text</ListItem></Appear>
<Appear><ListItem>Flexbox layout system</ListItem></Appear>
<Appear><ListItem>React-Router navigation</ListItem></Appear>
<Appear><ListItem>PDF export</ListItem></Appear>
<Appear><ListItem>And...</ListItem></Appear>
</List>
</Slide>
</Deck>
</Spectacle>);
}
}
+148
View File
@@ -0,0 +1,148 @@
// Type definitions for Spectacle 1.1.1
// Project: https://github.com/FormidableLabs/victory
// Definitions by: Zachary Maybury <https://github.com/zmaybury>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../react/react.d.ts"/>
declare module "spectacle" {
import * as React from "react";
/**
* Transition Types for Spectacle
*/
type transitionType = "slide"|"zoom"|"fade"|"spin";
/**
* Progress Types for Spectacle
*/
type progressType = "pacman"|"bar"|"number"|"none";
/**
* Alignment Types for Spectacle
*/
type alignType =
"flex-start flex-start"|"flex-start center"|"flex-start flex-end"|
"center flex-start"|"center center"|"center flex-end"|
"flex-end flex-start"|"flex-end center"|"flex-end flex-end";
/**
* Base props for many Spectacle components
*/
export interface BaseProps {
italic?:boolean,
bold?:boolean,
caps?:boolean,
margin?:number|string,
padding?:number|string,
textColor?:string,
textSize?:string,
textAlign?:string,
textFont?:string,
bgColor?:string,
bgImage?:string,
bgDarken?:number
}
export interface SpectacleProps {
theme?:{ [key: string ]: string | number }
}
export interface DeckProps {
transition?:transitionType[],
transitionDuration?:number,
progress?:progressType,
controls?:boolean
}
export interface SlideProps extends BaseProps {
align?:alignType,
transition?:transitionType[],
transitionDuration?:number,
notes?:string,
id?:string
}
export interface MarkdownProps {
source?:string,
mdastConfig?:{ [key: string ]: string | number }
}
export interface CodePaneProps extends BaseProps {
lang?:string,
source?:string
}
export interface HeadingProps extends BaseProps {
fit?:boolean,
lineHeight?:number
size?:number;
}
export interface ImageProps extends BaseProps {
display?:string,
height?:number,
src?:string,
width?:number|string
}
export interface LinkProps extends BaseProps {
href?:string
}
export interface SProps extends BaseProps {
type?:string
}
export interface TextProps extends BaseProps {
fit?:boolean,
lineHeight?:number
}
export class Spectacle extends React.Component<SpectacleProps, any> {}
export class Deck extends React.Component<DeckProps, any> {}
export class Slide extends React.Component<SlideProps, any> {}
export class Layout extends React.Component<any, any> {}
export class Fit extends React.Component<any, any> {}
export class Fill extends React.Component<any, any> {}
export class Markdown extends React.Component<MarkdownProps, any> {}
export class Appear extends React.Component<any, any> {}
export class BlockQuote extends React.Component<BaseProps, any> {}
export class Quote extends React.Component<BaseProps, any> {}
export class Cite extends React.Component<BaseProps, any> {}
export class CodePane extends React.Component<CodePaneProps, any> {}
export class Code extends React.Component<BaseProps, any> {}
export class Heading extends React.Component<HeadingProps, any> {}
export class Image extends React.Component<ImageProps, any> {}
export class Link extends React.Component<LinkProps, any> {}
export class List extends React.Component<BaseProps, any> {}
export class ListItem extends React.Component<BaseProps, any> {}
export class S extends React.Component<SProps, any> {}
export class Table extends React.Component<BaseProps, any> {}
export class TableRow extends React.Component<BaseProps, any> {}
export class TableHeaderItem extends React.Component<BaseProps, any> {}
export class TableItem extends React.Component<BaseProps, any> {}
export class Text extends React.Component<TextProps, any> {}
}
+472 -342
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -114,7 +114,7 @@
clothGeometry.dynamic = true;
clothGeometry.computeFaceNormals();
var uniforms = { texture: { type: "t", value: clothTexture } };
var uniforms = { texture: { value: clothTexture } };
var vertexShader = document.getElementById('vertexShaderDepth').textContent;
var fragmentShader = document.getElementById('fragmentShaderDepth').textContent;
@@ -182,7 +182,7 @@
scene.add( helper );
var clipMorpher = THREE.AnimationClip.CreateFromMorphTargetSequence( 'facialExpressions', mesh.geometry.morphTargets, 3 );
var clipMorpher = THREE.AnimationClip.CreateFromMorphTargetSequence( 'facialExpressions', mesh.geometry.morphTargets, 3, true );
var clipBones = geometry.animations[0];
mixer = new THREE.AnimationMixer( mesh );
+4 -4
View File
@@ -95,10 +95,10 @@
var vertexShader = document.getElementById( 'vertexShader' ).textContent;
var fragmentShader = document.getElementById( 'fragmentShader' ).textContent;
var uniforms = {
topColor: { type: "c", value: new THREE.Color( 0x0077ff ) },
bottomColor: { type: "c", value: new THREE.Color( 0xffffff ) },
offset: { type: "f", value: 33 },
exponent: { type: "f", value: 0.6 }
topColor: { value: new THREE.Color( 0x0077ff ) },
bottomColor: { value: new THREE.Color( 0xffffff ) },
offset: { value: 33 },
exponent: { value: 0.6 }
};
uniforms.topColor.value.copy( hemiLight.color );
+1
View File
@@ -28,6 +28,7 @@ declare namespace THREE {
maxDistance:number;
keys:number[];
target: THREE.Vector3;
position0: THREE.Vector3;
target0: THREE.Vector3;
up0: THREE.Vector3;
+2 -2
View File
@@ -24,8 +24,8 @@ declare namespace vuejs {
statusText: string;
headers: Function;
text():string;
json():string;
blob():string;
json():any;
blob():Blob;
}
interface HttpOptions {
@@ -0,0 +1,9 @@
///<reference path="webpack-fail-plugin.d.ts" />
import * as Webpack from "webpack";
import FailPlugin = require("webpack-fail-plugin");
const config: Webpack.Configuration = {
plugins: [
FailPlugin
]
}
+17
View File
@@ -0,0 +1,17 @@
// Type definitions for webpack-fail-plugin v1.0.5
// Project: https://github.com/TiddoLangerak/webpack-fail-plugin
// Definitions by: Simon Hartcher <https://github.com/deevus>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
///<reference path="./../webpack/webpack.d.ts" />
declare module "webpack-fail-plugin" {
import {Plugin} from "webpack";
/**
* Webpack plugin that will make the process return status code 1 when it finishes with errors in single-run mode.
*/
function WebpackFailPlugin(): Plugin;
export = WebpackFailPlugin;
}
+14
View File
@@ -0,0 +1,14 @@
///<reference path="webpack-merge.d.ts" />
import merge = require("webpack-merge");
import {Configuration} from "webpack";
const a: Configuration = {
entry: "test.js"
}
const b: Configuration = {
devtool: "source-map"
}
const c = merge(a, b);
const d = merge.smart(a, b);
+25
View File
@@ -0,0 +1,25 @@
// Type definitions for webpack-merge
// Project: https://github.com/survivejs/webpack-merge
// Definitions by: Simon Hartcher <https://github.com/deevus>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
///<reference path="../webpack/webpack.d.ts" />
declare module "webpack-merge" {
import {Configuration} from "webpack";
interface WebpackMerge {
/**
* Merge multiple webpack configurations into one.
*/
(...configs: Configuration[]): Configuration;
/**
* Merge multiple webpack configurations into one, with smart merging of loaders.
*/
smart(...configs: Configuration[]): Configuration;
}
const merge: WebpackMerge;
export = merge;
}
@@ -0,0 +1,17 @@
///<reference path="webpack-validator.d.ts" />
import {Configuration} from "webpack";
import validate = require("webpack-validator");
const a: Configuration = {
entry: "test"
}
const b = validate(a);
const c = validate(b, {
"no-root-files-node-modules-nameclash": true
});
const d = validate(b, {
"loader-enforce-include-or-exclude": false,
"loader-prefer-include": true
});
+27
View File
@@ -0,0 +1,27 @@
// Type definitions for webpack-validator v2.2.6
// Project: https://github.com/js-dxtools/webpack-validator
// Definitions by: Simon Hartcher <https://github.com/deevus>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
///<reference path="../webpack/webpack.d.ts" />
declare module "webpack-validator" {
import {Configuration} from "webpack";
interface ValidationOptions {
"no-root-files-node-modules-nameclash"?: boolean;
"loader-enforce-include-or-exclude"?: boolean;
"loader-prefer-include"?: boolean;
}
/**
* Validate your webpack configs with joi
*/
function Validate(config: Configuration): Configuration;
/**
* Validate your webpack configs with joi
*/
function Validate(config: Configuration, options: ValidationOptions): Configuration;
export = Validate;
}
+13
View File
@@ -39,6 +39,19 @@ function test_HeadersCopiedFromHash3() {
return new Headers(source);
}
function test_HeadersCopiedFromHeaders() {
var source = new Headers();
source.append('Content-Type', 'application/json');
return new Headers(source);
}
function test_HeadersCopiedFromHash() {
var source:HeadersMap = {
'Content-Type': 'application/json'
};
return new Headers(source);
}
function test_fetchUrlWithOptions() {
var headers = new Headers();
headers.append("Content-Type", "application/json");
+12
View File
@@ -0,0 +1,12 @@
// Type definitions for window-size 0.2.0
// Project: https://github.com/jonschlinkert/window-size
// Definitions by: Pouya Kary <https://github.com/pmkary>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare module "window-size" {
/** Height of the terminal window.*/
export const height: number;
/** Width of the terminal window.*/
export const width: number;
}