mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 14:57:10 +00:00
Merge https://github.com/DefinitelyTyped/DefinitelyTyped into add-dva
This commit is contained in:
@@ -15,3 +15,18 @@ var $jwtInterceptor: ng.jwt.IJwtInterceptor;
|
||||
$jwtInterceptor.tokenGetter = () => {
|
||||
return expToken;
|
||||
}
|
||||
|
||||
|
||||
var authManager: ng.jwt.IAuthManagerServiceProvider;
|
||||
|
||||
// Indicate the user is authenticated
|
||||
authManager.authenticate();
|
||||
|
||||
// Indicate the user is unauthenticated
|
||||
authManager.unauthenticate();
|
||||
|
||||
// Keep the user authenticated
|
||||
authManager.checkAuthOnRefresh();
|
||||
|
||||
// Redirect the user on unauthorized requests
|
||||
authManager.redirectWhenUnauthenticated();
|
||||
Vendored
+7
@@ -27,4 +27,11 @@ declare namespace angular.jwt {
|
||||
interface IJwtInterceptor {
|
||||
tokenGetter(...params : any[]): string;
|
||||
}
|
||||
|
||||
interface IAuthManagerServiceProvider {
|
||||
authenticate(): void;
|
||||
unauthenticate(): void;
|
||||
checkAuthOnRefresh(): void;
|
||||
redirectWhenUnauthenticated(): void;
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+1
-2
@@ -1,6 +1,6 @@
|
||||
// Type definitions for Angular JS 1.5
|
||||
// Project: http://angularjs.org
|
||||
// Definitions by: Diego Vilar <http://github.com/diegovilar>
|
||||
// Definitions by: Diego Vilar <http://github.com/diegovilar>, Georgii Dolzhykov <http://github.com/thorn0>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
|
||||
@@ -238,7 +238,6 @@ declare namespace angular {
|
||||
* @param directiveFactory An injectable directive factory function.
|
||||
*/
|
||||
directive(name: string, inlineAnnotatedFunction: any[]): IModule;
|
||||
directive(name: string, injectionFunction: Function): IModule;
|
||||
directive(object: Object): IModule;
|
||||
/**
|
||||
* Register a service factory, which will be called to return the service instance. This is short for registering a service where its provider consists of only a $get property, which is the given service factory function. You should use $provide.factory(getFn) if you do not need to configure your service in a provider.
|
||||
|
||||
@@ -4,55 +4,29 @@ import lambda = require('aws-lambda');
|
||||
|
||||
var str: string;
|
||||
var date: Date;
|
||||
var sns: lambda.SNS;
|
||||
var kinesis: lambda.Kinesis;
|
||||
var recordsList: lambda.Record[];
|
||||
var anyObj: any;
|
||||
var num: number;
|
||||
var identity: lambda.Identity;
|
||||
var identity: lambda.CognitoIdentity;
|
||||
var error: Error;
|
||||
|
||||
/* Records */
|
||||
var records: lambda.Records;
|
||||
|
||||
recordsList = records.Records;
|
||||
|
||||
/* Record */
|
||||
var record: lambda.Record;
|
||||
|
||||
str = record.EventVersion;
|
||||
str = record.EventSubscriptionArn;
|
||||
str = record.EnventSource;
|
||||
sns = record.Sns;
|
||||
kinesis = record.kinesis;
|
||||
|
||||
/* SNS */
|
||||
str = sns.Type;
|
||||
str = sns.MessageId;
|
||||
str = sns.TopicArn;
|
||||
str = sns.Subject;
|
||||
str = sns.Message;
|
||||
date = sns.Timestamp;
|
||||
|
||||
/* Kinesis */
|
||||
var kinesis: lambda.Kinesis;
|
||||
|
||||
str = kinesis.data;
|
||||
var b: boolean;
|
||||
var clientCtx: lambda.ClientContext;
|
||||
|
||||
/* Context */
|
||||
var context: lambda.Context;
|
||||
|
||||
context.log(str, anyObj);
|
||||
context.fail(str);
|
||||
context.succeed(str);
|
||||
context.succeed(anyObj);
|
||||
context.succeed(str, anyObj);
|
||||
b = context.callbackWaitsForEmptyEventLoop;
|
||||
str = context.functionName;
|
||||
str = context.functionVersion;
|
||||
str = context.invokedFunctionArn;
|
||||
num = context.memoryLimitInMB;
|
||||
str = context.awsRequestId;
|
||||
num = context.getRemainingTimeInMillis();
|
||||
str = context.logGroupName;
|
||||
str = context.logStreamName;
|
||||
identity = context.identity;
|
||||
clientCtx = context.clientContext;
|
||||
|
||||
/* Identity */
|
||||
var identity: lambda.Identity;
|
||||
/* CognitoIdentity */
|
||||
var identity: lambda.CognitoIdentity;
|
||||
|
||||
str = identity.cognitoIdentityId;
|
||||
str = identity.cognitoIdentityPoolId;
|
||||
|
||||
Vendored
+48
-35
@@ -1,55 +1,68 @@
|
||||
// Type definitions for AWS Lambda
|
||||
// Project: http://docs.aws.amazon.com/lambda
|
||||
// Definitions by: Michael Skarum <https://github.com/skarum>
|
||||
// Definitions by: James Darbyshire <https://github.com/darbio/aws-lambda-typescript>, Michael Skarum <https://github.com/skarum>, Stef Heyenrath <https://github.com/StefH/DefinitelyTyped>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare module "aws-lambda" {
|
||||
// Context
|
||||
// http://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-context.html
|
||||
interface Context {
|
||||
// Properties
|
||||
callbackWaitsForEmptyEventLoop: boolean;
|
||||
functionName: string;
|
||||
functionVersion: string;
|
||||
invokedFunctionArn: string;
|
||||
memoryLimitInMB: number;
|
||||
awsRequestId: string;
|
||||
logGroupName: string;
|
||||
logStreamName: string;
|
||||
identity?: CognitoIdentity;
|
||||
clientContext?: ClientContext;
|
||||
|
||||
// Functions
|
||||
getRemainingTimeInMillis(): number;
|
||||
|
||||
export interface Records {
|
||||
Records: Record[];
|
||||
}
|
||||
interface Record {
|
||||
EventVersion: string;
|
||||
EventSubscriptionArn: string;
|
||||
EnventSource: string;
|
||||
Sns: SNS;
|
||||
kinesis: Kinesis;
|
||||
}
|
||||
interface SNS {
|
||||
Type: string;
|
||||
MessageId: string;
|
||||
TopicArn: string;
|
||||
Subject: string;
|
||||
Message: string;
|
||||
Timestamp: Date;
|
||||
}
|
||||
|
||||
interface Kinesis {
|
||||
data: string;
|
||||
}
|
||||
|
||||
export interface Context {
|
||||
// Functions for compatibility with earlier Node.js Runtime v0.10.42
|
||||
log(message: string, object: any): void;
|
||||
fail(message: string): void;
|
||||
succeed(message: string): void;
|
||||
succeed(object: any): void;
|
||||
succeed(message: string, object: any): void;
|
||||
awsRequestId: string;
|
||||
getRemainingTimeInMillis(): number;
|
||||
/** Information about the Amazon Cognito identity provider when invoked through the AWS Mobile SDK. It can be null. */
|
||||
identity?: Identity;
|
||||
succeed(message: string, object: any): void;
|
||||
}
|
||||
|
||||
interface Identity {
|
||||
|
||||
interface CognitoIdentity {
|
||||
cognitoIdentityId: string;
|
||||
cognitoIdentityPoolId: string;
|
||||
}
|
||||
|
||||
|
||||
interface ClientContext {
|
||||
client: ClientContextClient;
|
||||
Custom?: any;
|
||||
env: ClientContextEnv;
|
||||
}
|
||||
|
||||
interface ClientContextClient {
|
||||
installationId: string;
|
||||
appTitle: string;
|
||||
appVersionName: string;
|
||||
appVersionCode: string;
|
||||
appPackageName: string;
|
||||
}
|
||||
|
||||
interface ClientContextEnv {
|
||||
platformVersion: string;
|
||||
platform: string;
|
||||
make: string;
|
||||
model: string;
|
||||
locale: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Optional callback parameter.
|
||||
* http://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-handler.html
|
||||
*
|
||||
* @param error – an optional parameter that you can use to provide results of the failed Lambda function execution.
|
||||
* @param result – an optional parameter that you can use to provide the result of a successful function execution. The result provided must be JSON.stringify compatible.
|
||||
* @param error – an optional parameter that you can use to provide results of the failed Lambda function execution.
|
||||
* @param result – an optional parameter that you can use to provide the result of a successful function execution. The result provided must be JSON.stringify compatible.
|
||||
*/
|
||||
export type Callback = (error?: Error, result?: any) => void;
|
||||
}
|
||||
Vendored
+1
@@ -235,6 +235,7 @@ declare module "aws-sdk" {
|
||||
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;
|
||||
waitFor(state: string, params: s3.HeadObjectRequest, callback: (err: Error, data: any) => void): void;
|
||||
}
|
||||
|
||||
export class STS {
|
||||
|
||||
@@ -17,7 +17,7 @@ declare namespace Microsoft.WindowsAzure {
|
||||
login(provider: string, token: string): asyncPromise;
|
||||
login(provider: string, callback: (error: any, user: User) => void ): void;
|
||||
login(provider: string): asyncPromise;
|
||||
logout(): void;
|
||||
logout(): asyncPromise;
|
||||
getTable(tableName: string): MobileServiceTable;
|
||||
withFilter(serviceFilter: (request: any, next: (request: any, callback: (error: any, response: any) => void) => void, callback: (error: any, response: any) => void) => void): MobileServiceClient;
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
/// <reference path="backlog-js.d.ts" />
|
||||
|
||||
import * as backlogjs from 'backlog-js';
|
||||
|
||||
const host = 'example.backlog.jp';
|
||||
const apiKey = 'apiKey';
|
||||
const clientId = 'clientId';
|
||||
const clientSecret = 'clientSecret';
|
||||
const redirectUri = 'redirectUri';
|
||||
const state = 'state';
|
||||
const code = 'code';
|
||||
const refreshToken = 'refreshToken';
|
||||
const configure = { host, apiKey }
|
||||
const credentials = { clientId, clientSecret }
|
||||
|
||||
const oauth2 = new backlogjs.OAuth2(credentials);
|
||||
oauth2.getAuthorizationURL({ host, redirectUri, state });
|
||||
oauth2.getAccessToken({ host, code, redirectUri }).then(data => {}).catch(err => {});
|
||||
oauth2.refreshAccessToken({ host, refreshToken }).then(data => {}).catch(err => {});
|
||||
|
||||
const backlog = new backlogjs.Backlog(configure);
|
||||
backlog.getSpace().then(data => { }).catch(err => { });
|
||||
backlog.getSpaceActivities({
|
||||
activityTypeId: [
|
||||
backlogjs.Option.ActivityType.IssueCreated,
|
||||
backlogjs.Option.ActivityType.IssueUpdated
|
||||
],
|
||||
minId: 1,
|
||||
maxId: 2,
|
||||
count: 3,
|
||||
order: "asc"
|
||||
}).then(data => { }).catch(err => { });
|
||||
backlog.getSpaceDiskUsage().then(data => { }).catch(err => { });
|
||||
backlog.getSpaceIcon().then(data => { }).catch(err => { });
|
||||
backlog.postSpaceAttachment(new FormData()).then(data => { }).catch(err => { });
|
||||
backlog.getUsers().then(data => { }).catch(err => { });
|
||||
backlog.getUser(1).then(data => { }).catch(err => { });
|
||||
backlog.postUser({
|
||||
userId: 'string',
|
||||
password: 'string',
|
||||
name: 'string',
|
||||
mailAddress: 'string',
|
||||
roleType: backlogjs.Option.User.RoleType.Admin
|
||||
}).then(data => { }).catch(err => { });
|
||||
backlog.patchUser(1, {
|
||||
password: 'string',
|
||||
name: 'string',
|
||||
mailAddress: 'string',
|
||||
roleType: backlogjs.Option.User.RoleType.Admin
|
||||
}).then(data => { }).catch(err => { });
|
||||
backlog.deleteUser(1).then(data => { }).catch(err => { });
|
||||
backlog.getMyself().then(data => { }).catch(err => { });
|
||||
backlog.getUserActivities(1, {
|
||||
activityTypeId: [
|
||||
backlogjs.Option.ActivityType.IssueCreated,
|
||||
backlogjs.Option.ActivityType.IssueUpdated
|
||||
],
|
||||
minId: 1,
|
||||
maxId: 2,
|
||||
count: 3,
|
||||
order: "asc"
|
||||
}).then(data => { }).catch(err => { });
|
||||
backlog.getUserStars(1, {
|
||||
minId: 1,
|
||||
maxId: 2,
|
||||
count: 3,
|
||||
order: "asc"
|
||||
}).then(data => { }).catch(err => { });
|
||||
backlog.getUserStarsCount(1, {
|
||||
since: 'YYYY-MM-DD',
|
||||
until: 'YYYY-MM-DD'
|
||||
}).then(data => { }).catch(err => { });
|
||||
backlog.getRecentlyViewedIssues({
|
||||
order: 'asc',
|
||||
offset: 1,
|
||||
count: 2
|
||||
}).then(data => { }).catch(err => { });
|
||||
backlog.getRecentlyViewedProjects({
|
||||
order: 'asc',
|
||||
offset: 1,
|
||||
count: 2
|
||||
}).then(data => { }).catch(err => { });
|
||||
backlog.getRecentlyViewedWikis({
|
||||
order: 'asc',
|
||||
offset: 1,
|
||||
count: 2
|
||||
}).then(data => { }).catch(err => { });
|
||||
backlog.getUserIcon(1).then(data => {}).catch(err => {});
|
||||
Vendored
+695
@@ -0,0 +1,695 @@
|
||||
// Type definitions for backlog-js 0.9.0
|
||||
// Project: https://github.com/nulab/backlog-js
|
||||
// Definitions by: Yuichi Watanabe <https://github.com/vvatanabe>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
/// <reference path="../isomorphic-fetch/isomorphic-fetch.d.ts" />
|
||||
/// <reference path="../node_modules/typescript/lib/lib.es6.d.ts" />
|
||||
|
||||
declare module 'backlog-js' {
|
||||
|
||||
class Request {
|
||||
private configure;
|
||||
constructor(configure: {
|
||||
host: string;
|
||||
apiKey?: string;
|
||||
accessToken?: string;
|
||||
timeout?: number;
|
||||
});
|
||||
get<T>(path: string, params?: any): Promise<T>;
|
||||
post<T>(path: string, params?: any): Promise<T>;
|
||||
put<T>(path: string, params: any): Promise<T>;
|
||||
patch<T>(path: string, params: any): Promise<T>;
|
||||
delete<T>(path: string, params?: any): Promise<T>;
|
||||
request(options: {
|
||||
method: string;
|
||||
path: string;
|
||||
params?: Params | FormData;
|
||||
}): Promise<IResponse>;
|
||||
checkStatus(response: IResponse): Promise<IResponse>;
|
||||
parseJSON<T>(response: IResponse): Promise<T>;
|
||||
private toFormData(params);
|
||||
private toQueryString(params);
|
||||
webAppBaseURL: string;
|
||||
restBaseURL: string;
|
||||
}
|
||||
|
||||
type Params = {
|
||||
[index: string]: number | string | number[] | string[];
|
||||
};
|
||||
|
||||
export class Backlog extends Request {
|
||||
constructor(configure: {
|
||||
host: string;
|
||||
apiKey?: string;
|
||||
accessToken?: string;
|
||||
timeout?: number;
|
||||
});
|
||||
getSpace(): Promise<any>;
|
||||
getSpaceActivities(params: Option.Space.GetActivitiesParams): Promise<any>;
|
||||
getSpaceNotification(): Promise<any>;
|
||||
putSpaceNotification(params: Option.Space.PutSpaceNotificationParams): Promise<any>;
|
||||
getSpaceDiskUsage(): Promise<any>;
|
||||
getSpaceIcon(): Promise<Entity.File.FileData>;
|
||||
postSpaceAttachment(form: FormData): Promise<IResponse>;
|
||||
getUsers(): Promise<any>;
|
||||
getUser(userId: number): Promise<any>;
|
||||
postUser(params: Option.User.PostUserParams): Promise<any>;
|
||||
patchUser(userId: number, params: Option.User.PatchUserParams): Promise<any>;
|
||||
deleteUser(userId: number): Promise<any>;
|
||||
getMyself(): Promise<any>;
|
||||
getUserActivities(userId: number, params: Option.User.GetUserActivitiesParams): Promise<any>;
|
||||
getUserStars(userId: number, params: Option.User.GetUserStarsParams): Promise<any>;
|
||||
getUserStarsCount(userId: number, params: Option.User.GetUserStarsCountParams): Promise<any>;
|
||||
getRecentlyViewedIssues(params: Option.User.GetRecentlyViewedParams): Promise<any>;
|
||||
getRecentlyViewedProjects(params: Option.User.GetRecentlyViewedParams): Promise<any>;
|
||||
getRecentlyViewedWikis(params: Option.User.GetRecentlyViewedParams): Promise<any>;
|
||||
getUserIcon(userId: number): Promise<Entity.File.FileData>;
|
||||
getGroups(params: Option.Group.GetGroupsParams): Promise<any>;
|
||||
postGroups(params: Option.Group.PostGroupsParams): Promise<any>;
|
||||
getGroup(groupId: number): Promise<any>;
|
||||
patchGroup(groupId: number, params: Option.Group.PatchGroupParams): Promise<any>;
|
||||
deleteGroup(groupId: number): Promise<any>;
|
||||
getStatuses(): Promise<any>;
|
||||
getResolutions(): Promise<any>;
|
||||
getPriorities(): Promise<any>;
|
||||
postProject(params: Option.Project.PostProjectParams): Promise<any>;
|
||||
getProjects(params?: Option.Project.GetProjectsParams): Promise<any>;
|
||||
getProject(projectIdOrKey: string): Promise<any>;
|
||||
patchProject(projectIdOrKey: string, params: Option.Project.PatchProjectParams): Promise<any>;
|
||||
deleteProject(projectIdOrKey: string): Promise<any>;
|
||||
getProjectActivities(projectIdOrKey: string, params: Option.Space.GetActivitiesParams): Promise<any>;
|
||||
getProjectUsers(projectIdOrKey: string): Promise<any>;
|
||||
deleteProjectUsers(projectIdOrKey: string, params: Option.Project.DeleteProjectUsersParams): Promise<any>;
|
||||
postProjectAdministrators(projectIdOrKey: string, params: Option.Project.PostProjectAdministrators): Promise<any>;
|
||||
getProjectAdministrators(projectIdOrKey: string): Promise<any>;
|
||||
deleteProjectAdministrators(projectIdOrKey: string, params: Option.Project.DeleteProjectAdministrators): Promise<any>;
|
||||
getIssueTypes(projectIdOrKey: string): Promise<any>;
|
||||
postIssueType(projectIdOrKey: string, params: Option.Project.PostIssueTypeParams): Promise<any>;
|
||||
patchIssueType(projectIdOrKey: string, id: number, params: Option.Project.PatchIssueTypeParams): Promise<any>;
|
||||
deleteIssueType(projectIdOrKey: string, id: number, params: Option.Project.DeleteIssueTypeParams): Promise<any>;
|
||||
getCategories(projectIdOrKey: string): Promise<any>;
|
||||
postCategories(projectIdOrKey: string, params: Option.Project.PostCategoriesParams): Promise<any>;
|
||||
patchCategories(projectIdOrKey: string, id: number, params: Option.Project.PatchCategoriesParams): Promise<any>;
|
||||
deleteCategories(projectIdOrKey: string, id: number): Promise<any>;
|
||||
getVersions(projectIdOrKey: string): Promise<any>;
|
||||
postVersions(projectIdOrKey: string, params: Option.Project.PostVersionsParams): Promise<any>;
|
||||
patchVersions(projectIdOrKey: string, id: number, params: Option.Project.PatchVersionsParams): Promise<any>;
|
||||
deleteVersions(projectIdOrKey: string, id: number): Promise<any>;
|
||||
getCustomFields(projectIdOrKey: string): Promise<any>;
|
||||
postCustomField(projectIdOrKey: string, params: Option.Project.PostCustomFieldParams | Option.Project.PostCustomFieldWithNumericParams | Option.Project.PostCustomFieldWithDateParams | Option.Project.PostCustomFieldWithListParams): Promise<any>;
|
||||
patchCustomField(projectIdOrKey: string, id: number, params: Option.Project.PatchCustomFieldParams | Option.Project.PatchCustomFieldWithNumericParams | Option.Project.PatchCustomFieldWithDateParams | Option.Project.PatchCustomFieldWithListParams): Promise<any>;
|
||||
deleteCustomField(projectIdOrKey: string, id: number): Promise<any>;
|
||||
postCustomFieldItem(projectIdOrKey: string, id: number, params: Option.Project.PostCustomFieldItemParams): Promise<any>;
|
||||
patchCustomFieldItem(projectIdOrKey: string, id: number, itemId: number, params: Option.Project.PatchCustomFieldItemParams): Promise<any>;
|
||||
deleteCustomFieldItem(projectIdOrKey: string, id: number, params: Option.Project.PostCustomFieldItemParams): Promise<any>;
|
||||
getSharedFiles(projectIdOrKey: string, path: string, params: Option.Project.GetSharedFilesParams): Promise<any>;
|
||||
getProjectsDiskUsage(projectIdOrKey: string): Promise<any>;
|
||||
getWebhooks(projectIdOrKey: string): Promise<any>;
|
||||
postWebhook(projectIdOrKey: string, params: Option.Project.PostWebhookParams): Promise<any>;
|
||||
getWebhook(projectIdOrKey: string, webhookId: string): Promise<any>;
|
||||
patchWebhook(projectIdOrKey: string, webhookId: string, params: Option.Project.PatchWebhookParams): Promise<any>;
|
||||
deleteWebhook(projectIdOrKey: string, webhookId: string): Promise<any>;
|
||||
postIssue(params: Option.Issue.PostIssueParams): Promise<any>;
|
||||
patchIssue(issueIdOrKey: string, params: Option.Issue.PatchIssueParams): Promise<any>;
|
||||
getIssues(params?: Option.Issue.GetIssuesParams): Promise<any>;
|
||||
getIssue(issueIdOrKey: string): Promise<any>;
|
||||
getIssuesCount(params?: Option.Issue.GetIssuesParams): Promise<any>;
|
||||
deleteIssuesCount(issueIdOrKey: string): Promise<any>;
|
||||
getIssueComments(issueIdOrKey: string, params: Option.Issue.GetIssueCommentsParams): Promise<any>;
|
||||
postIssueComments(issueIdOrKey: string, params: Option.Issue.PostIssueCommentsParams): Promise<any>;
|
||||
getIssueCommentsCount(issueIdOrKey: string): Promise<any>;
|
||||
getIssueComment(issueIdOrKey: string, commentId: number): Promise<any>;
|
||||
patchIssueComment(issueIdOrKey: string, commentId: number, params: Option.Issue.PatchIssueCommentParams): Promise<any>;
|
||||
getIssueCommentNotifications(issueIdOrKey: string, commentId: number): Promise<any>;
|
||||
postIssueCommentNotifications(issueIdOrKey: string, commentId: number, prams: Option.Issue.IssueCommentNotifications): Promise<any>;
|
||||
getIssueAttachments(issueIdOrKey: string): Promise<any>;
|
||||
deleteIssueAttachment(issueIdOrKey: string, attachmentId: string): Promise<any>;
|
||||
getIssueSharedFiles(issueIdOrKey: string): Promise<any>;
|
||||
linkIssueSharedFiles(issueIdOrKey: string, params: Option.Issue.LinkIssueSharedFilesParams): Promise<any>;
|
||||
unlinkIssueSharedFile(issueIdOrKey: string, id: number): Promise<any>;
|
||||
getWikis(projectIdOrKey: number): Promise<any>;
|
||||
getWikisCount(projectIdOrKey: number): Promise<any>;
|
||||
getWikisTags(projectIdOrKey: number): Promise<any>;
|
||||
postWiki(params: Option.Wiki.PostWikiParams): Promise<any>;
|
||||
getWiki(wikiId: number): Promise<any>;
|
||||
patchWiki(wikiId: number, params: Option.Wiki.PatchWikiParams): Promise<any>;
|
||||
deleteWiki(wikiId: number, mailNotify: boolean): Promise<any>;
|
||||
getWikisAttachments(wikiId: number): Promise<any>;
|
||||
postWikisAttachments(wikiId: number, attachmentId: number[]): Promise<any>;
|
||||
deleteWikisAttachments(wikiId: number, attachmentId: number): Promise<any>;
|
||||
getWikisSharedFiles(wikiId: number): Promise<any>;
|
||||
linkWikisSharedFiles(wikiId: number, fileId: number[]): Promise<any>;
|
||||
unlinkWikisSharedFiles(wikiId: number, id: number): Promise<any>;
|
||||
getWikisHistory(wikiId: number, params: Option.Wiki.GetWikisHistoryParams): Promise<any>;
|
||||
getWikisStars(wikiId: number): Promise<any>;
|
||||
postStar(params: Option.Project.PostStarParams): Promise<any>;
|
||||
getNotifications(params: Option.Notification.GetNotificationsParams): Promise<any>;
|
||||
getNotificationsCount(params: Option.Notification.GetNotificationsCountParams): Promise<any>;
|
||||
resetNotificationsMarkAsRead(): Promise<any>;
|
||||
markAsReadNotification(id: number): Promise<any>;
|
||||
getGitRepositories(projectIdOrKey: string): Promise<any>;
|
||||
getGitRepository(projectIdOrKey: string, repoIdOrName: string): Promise<any>;
|
||||
getPullRequests(projectIdOrKey: string, repoIdOrName: string, params: Option.PullRequest.GetPullRequestsParams): Promise<any>;
|
||||
getPullRequestsCount(projectIdOrKey: string, repoIdOrName: string, params: Option.PullRequest.GetPullRequestsParams): Promise<any>;
|
||||
postPullRequest(projectIdOrKey: string, repoIdOrName: string, params: Option.PullRequest.PostPullRequestParams): Promise<any>;
|
||||
getPullRequest(projectIdOrKey: string, repoIdOrName: string, number: number): Promise<any>;
|
||||
patchPullRequest(projectIdOrKey: string, repoIdOrName: string, number: number, params: Option.PullRequest.PatchPullRequestParams): Promise<any>;
|
||||
getPullRequestComments(projectIdOrKey: string, repoIdOrName: string, number: number, params: Option.PullRequest.GetPullRequestCommentsParams): Promise<any>;
|
||||
postPullRequestComments(projectIdOrKey: string, repoIdOrName: string, number: number, params: Option.PullRequest.PostPullRequestCommentsParams): Promise<any>;
|
||||
getPullRequestCommentsCount(projectIdOrKey: string, repoIdOrName: string, number: number): Promise<any>;
|
||||
patchPullRequestComments(projectIdOrKey: string, repoIdOrName: string, number: number, commentId: number, params: Option.PullRequest.PatchPullRequestCommentsParams): Promise<any>;
|
||||
getPullRequestAttachments(projectIdOrKey: string, repoIdOrName: string, number: number): Promise<any>;
|
||||
deletePullRequestAttachment(projectIdOrKey: string, repoIdOrName: string, number: number, attachmentId: number): Promise<any>;
|
||||
getProjectIcon(projectIdOrKey: string): Promise<Entity.File.FileData>;
|
||||
getSharedFile(projectIdOrKey: string, sharedFileId: number): Promise<Entity.File.FileData>;
|
||||
getIssueAttachment(issueIdOrKey: string, attachmentId: number): Promise<Entity.File.FileData>;
|
||||
getWikiAttachment(wikiId: number, attachmentId: number): Promise<Entity.File.FileData>;
|
||||
getPullRequestAttachment(projectIdOrKey: string, repoIdOrName: string, number: number, attachmentId: number): Promise<Entity.File.FileData>;
|
||||
private download(path);
|
||||
private upload(path, params);
|
||||
private parseFileData(response);
|
||||
}
|
||||
|
||||
export class OAuth2 {
|
||||
private credentials;
|
||||
private timeout;
|
||||
constructor(credentials: Option.OAuth2.Credentials, timeout?: number);
|
||||
getAuthorizationURL(options: {
|
||||
host: string;
|
||||
redirectUri?: string;
|
||||
state?: string;
|
||||
}): string;
|
||||
getAccessToken(options: {
|
||||
host: string;
|
||||
code: string;
|
||||
redirectUri?: string;
|
||||
}): Promise<Entity.OAuth2.AccessToken>;
|
||||
refreshAccessToken(options: {
|
||||
host: string;
|
||||
refreshToken: string;
|
||||
}): Promise<Entity.OAuth2.AccessToken>;
|
||||
}
|
||||
|
||||
import { PassThrough } from 'stream';
|
||||
export namespace Entity {
|
||||
export namespace File {
|
||||
export type FileData = NodeFileData | BrowserFileData;
|
||||
export interface NodeFileData {
|
||||
body: PassThrough;
|
||||
url: string;
|
||||
filename: string;
|
||||
}
|
||||
export interface BrowserFileData {
|
||||
body: any;
|
||||
url: string;
|
||||
blob?: () => Promise<Blob>;
|
||||
}
|
||||
}
|
||||
export namespace OAuth2 {
|
||||
export interface AccessToken {
|
||||
access_token: string;
|
||||
token_type: string;
|
||||
expires_in: number;
|
||||
refresh_token: string;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export namespace Option {
|
||||
export type Order = "asc" | "desc";
|
||||
export enum ActivityType {
|
||||
Undefined = -1,
|
||||
IssueCreated = 1,
|
||||
IssueUpdated = 2,
|
||||
IssueCommented = 3,
|
||||
IssueDeleted = 4,
|
||||
WikiCreated = 5,
|
||||
WikiUpdated = 6,
|
||||
WikiDeleted = 7,
|
||||
FileAdded = 8,
|
||||
FileUpdated = 9,
|
||||
FileDeleted = 10,
|
||||
SvnCommitted = 11,
|
||||
GitPushed = 12,
|
||||
GitRepositoryCreated = 13,
|
||||
IssueMultiUpdated = 14,
|
||||
ProjectUserAdded = 15,
|
||||
ProjectUserRemoved = 16,
|
||||
NotifyAdded = 17,
|
||||
PullRequestAdded = 18,
|
||||
PullRequestUpdated = 19,
|
||||
PullRequestCommented = 20,
|
||||
PullRequestMerged = 21,
|
||||
}
|
||||
export namespace Notification {
|
||||
export interface GetNotificationsParams {
|
||||
minId?: number;
|
||||
maxId?: number;
|
||||
count?: number;
|
||||
order?: Order;
|
||||
}
|
||||
export interface GetNotificationsCountParams {
|
||||
alreadyRead: boolean;
|
||||
resourceAlreadyRead: boolean;
|
||||
}
|
||||
}
|
||||
export namespace Space {
|
||||
export interface GetActivitiesParams {
|
||||
activityTypeId?: ActivityType[];
|
||||
minId?: number;
|
||||
maxId?: number;
|
||||
count?: number;
|
||||
order?: Order;
|
||||
}
|
||||
export interface PutSpaceNotificationParams {
|
||||
content: string;
|
||||
}
|
||||
}
|
||||
export namespace User {
|
||||
export interface PostUserParams {
|
||||
userId: string;
|
||||
password: string;
|
||||
name: string;
|
||||
mailAddress: string;
|
||||
roleType: RoleType;
|
||||
}
|
||||
export interface PatchUserParams {
|
||||
password?: string;
|
||||
name?: string;
|
||||
mailAddress?: string;
|
||||
roleType?: RoleType;
|
||||
}
|
||||
export enum RoleType {
|
||||
Admin = 1,
|
||||
User = 2,
|
||||
Reporter = 3,
|
||||
Viewer = 4,
|
||||
GuestReporter = 5,
|
||||
GuestViewer = 6,
|
||||
}
|
||||
export interface GetUserActivitiesParams {
|
||||
activityTypeId?: ActivityType[];
|
||||
minId?: number;
|
||||
maxId?: number;
|
||||
count?: number;
|
||||
order?: Order;
|
||||
}
|
||||
export interface GetUserStarsParams {
|
||||
minId?: number;
|
||||
maxId?: number;
|
||||
count?: number;
|
||||
order?: Order;
|
||||
}
|
||||
export interface GetUserStarsCountParams {
|
||||
since?: string;
|
||||
until?: string;
|
||||
}
|
||||
export interface GetRecentlyViewedParams {
|
||||
order?: Order;
|
||||
offset?: number;
|
||||
count?: number;
|
||||
}
|
||||
}
|
||||
export namespace Group {
|
||||
export interface GetGroupsParams {
|
||||
order?: Order;
|
||||
offset?: number;
|
||||
count?: number;
|
||||
}
|
||||
export interface PostGroupsParams {
|
||||
name: string;
|
||||
members?: string[];
|
||||
}
|
||||
export interface PatchGroupParams {
|
||||
name?: string;
|
||||
members?: string[];
|
||||
}
|
||||
}
|
||||
export namespace Project {
|
||||
export type TextFormattingRule = "backlog" | "markdown";
|
||||
export interface PostProjectParams {
|
||||
name: string;
|
||||
key: string;
|
||||
chartEnabled: boolean;
|
||||
projectLeaderCanEditProjectLeader?: boolean;
|
||||
subtaskingEnabled: boolean;
|
||||
textFormattingRule: TextFormattingRule;
|
||||
}
|
||||
export interface PatchProjectParams {
|
||||
name?: string;
|
||||
key?: string;
|
||||
chartEnabled?: boolean;
|
||||
subtaskingEnabled?: boolean;
|
||||
projectLeaderCanEditProjectLeader?: boolean;
|
||||
textFormattingRule?: TextFormattingRule;
|
||||
archived?: boolean;
|
||||
}
|
||||
export interface GetProjectsParams {
|
||||
archived?: boolean;
|
||||
all?: boolean;
|
||||
}
|
||||
export interface DeleteProjectUsersParams {
|
||||
userId: number;
|
||||
}
|
||||
export interface PostProjectAdministrators {
|
||||
userId: number;
|
||||
}
|
||||
export interface DeleteProjectAdministrators {
|
||||
userId: number;
|
||||
}
|
||||
export type IssueTypeColor = "#e30000" | "#990000" | "#934981" | "#814fbc" | "#2779ca" | "#007e9a" | "#7ea800" | "#ff9200" | "#ff3265" | "#666665";
|
||||
export interface PostIssueTypeParams {
|
||||
name: string;
|
||||
color: IssueTypeColor;
|
||||
}
|
||||
export interface PatchIssueTypeParams {
|
||||
name?: string;
|
||||
color?: IssueTypeColor;
|
||||
}
|
||||
export interface DeleteIssueTypeParams {
|
||||
substituteIssueTypeId: number;
|
||||
}
|
||||
export interface PostCategoriesParams {
|
||||
name: string;
|
||||
}
|
||||
export interface PatchCategoriesParams {
|
||||
name: string;
|
||||
}
|
||||
export interface PostVersionsParams {
|
||||
name: string;
|
||||
description: string;
|
||||
startDate: string;
|
||||
releaseDueDate: string;
|
||||
}
|
||||
export interface PatchVersionsParams {
|
||||
name: string;
|
||||
description?: string;
|
||||
startDate?: string;
|
||||
releaseDueDate?: string;
|
||||
archived?: boolean;
|
||||
}
|
||||
export interface PostCustomFieldParams {
|
||||
typeId: FieldType;
|
||||
name: string;
|
||||
applicableIssueTypes?: number[];
|
||||
description?: string;
|
||||
required?: boolean;
|
||||
}
|
||||
export interface PostCustomFieldWithNumericParams extends PostCustomFieldParams {
|
||||
min?: number;
|
||||
max?: number;
|
||||
initialValue?: number;
|
||||
unit?: string;
|
||||
}
|
||||
export interface PostCustomFieldWithDateParams extends PostCustomFieldParams {
|
||||
min?: string;
|
||||
max?: string;
|
||||
initialValueType?: number;
|
||||
initialDate?: string;
|
||||
initialShift?: number;
|
||||
}
|
||||
export interface PostCustomFieldWithListParams extends PostCustomFieldParams {
|
||||
items?: string[];
|
||||
allowInput?: boolean;
|
||||
allowAddItem?: boolean;
|
||||
}
|
||||
export interface PatchCustomFieldParams {
|
||||
name?: string;
|
||||
applicableIssueTypes?: number[];
|
||||
description?: string;
|
||||
required?: boolean;
|
||||
}
|
||||
export interface PatchCustomFieldWithNumericParams extends PatchCustomFieldParams {
|
||||
min?: number;
|
||||
max?: number;
|
||||
initialValue?: number;
|
||||
unit?: string;
|
||||
}
|
||||
export interface PatchCustomFieldWithDateParams extends PatchCustomFieldParams {
|
||||
min?: string;
|
||||
max?: string;
|
||||
initialValueType?: number;
|
||||
initialDate?: string;
|
||||
initialShift?: number;
|
||||
}
|
||||
export interface PatchCustomFieldWithListParams extends PatchCustomFieldParams {
|
||||
items?: string[];
|
||||
allowInput?: boolean;
|
||||
allowAddItem?: boolean;
|
||||
}
|
||||
export interface PostCustomFieldItemParams {
|
||||
name: string;
|
||||
}
|
||||
export interface PatchCustomFieldItemParams {
|
||||
name: string;
|
||||
}
|
||||
export interface GetSharedFilesParams {
|
||||
order?: Order;
|
||||
offset?: number;
|
||||
count?: number;
|
||||
}
|
||||
export interface PostWebhookParams {
|
||||
name?: string;
|
||||
description?: string;
|
||||
hookUrl?: string;
|
||||
allEvent?: boolean;
|
||||
activityTypeIds?: number[];
|
||||
}
|
||||
export interface PatchWebhookParams {
|
||||
name?: string;
|
||||
description?: string;
|
||||
hookUrl?: string;
|
||||
allEvent?: boolean;
|
||||
activityTypeIds?: number[];
|
||||
}
|
||||
export enum FieldType {
|
||||
Text = 1,
|
||||
TextArea = 2,
|
||||
Numeric = 3,
|
||||
Date = 4,
|
||||
SingleList = 5,
|
||||
MultipleList = 6,
|
||||
CheckBox = 7,
|
||||
Radio = 8,
|
||||
}
|
||||
export interface PostStarParams {
|
||||
issueId?: number;
|
||||
commentId?: number;
|
||||
wikiId?: number;
|
||||
pullRequestId?: number;
|
||||
pullRequestCommentId?: number;
|
||||
}
|
||||
}
|
||||
export namespace Issue {
|
||||
export interface PostIssueParams {
|
||||
projectId: number;
|
||||
summary: string;
|
||||
priorityId: number;
|
||||
issueTypeId: number;
|
||||
parentIssueId?: number;
|
||||
description?: string;
|
||||
startDate?: string;
|
||||
dueDate?: string;
|
||||
estimatedHours?: number;
|
||||
actualHours?: number;
|
||||
categoryId?: number[];
|
||||
versionId?: number[];
|
||||
milestoneId?: number[];
|
||||
assigneeId?: number;
|
||||
notifiedUserId?: number[];
|
||||
attachmentId?: number[];
|
||||
[customField_: string]: any;
|
||||
}
|
||||
export interface PatchIssueParams {
|
||||
summary?: string;
|
||||
parentIssueId?: number;
|
||||
description?: string;
|
||||
statusId?: number;
|
||||
resolutionId?: number;
|
||||
startDate?: string;
|
||||
dueDate?: string;
|
||||
estimatedHours?: number;
|
||||
actualHours?: number;
|
||||
issueTypeId?: number;
|
||||
categoryId?: number[];
|
||||
versionId?: number[];
|
||||
milestoneId?: number[];
|
||||
priorityId?: number;
|
||||
assigneeId?: number;
|
||||
notifiedUserId?: number[];
|
||||
attachmentId?: number[];
|
||||
comment?: string;
|
||||
[customField_: string]: any;
|
||||
}
|
||||
export interface GetIssuesParams {
|
||||
projectId?: number[];
|
||||
issueTypeId?: number[];
|
||||
categoryId?: number[];
|
||||
versionId?: number[];
|
||||
milestoneId?: number[];
|
||||
statusId?: number[];
|
||||
priorityId?: number[];
|
||||
assigneeId?: number[];
|
||||
createdUserId?: number[];
|
||||
resolutionId?: number[];
|
||||
parentChild?: ParentChildType;
|
||||
attachment?: boolean;
|
||||
sharedFile?: boolean;
|
||||
sort?: SortKey;
|
||||
order?: Order;
|
||||
offset?: number;
|
||||
count?: number;
|
||||
createdSince?: string;
|
||||
createdUntil?: string;
|
||||
updatedSince?: string;
|
||||
updatedUntil?: string;
|
||||
startDateSince?: string;
|
||||
startDateUntil?: string;
|
||||
dueDateSince?: string;
|
||||
dueDateUntil?: string;
|
||||
id?: number[];
|
||||
parentIssueId?: number[];
|
||||
keyword: string;
|
||||
[customField_: string]: any;
|
||||
}
|
||||
export enum ParentChildType {
|
||||
All = 0,
|
||||
NotChild = 1,
|
||||
Child = 2,
|
||||
NotChildNotParent = 3,
|
||||
Parent = 4,
|
||||
}
|
||||
export type SortKey = "issueType" | "category" | "version" | "milestone" | "summary" | "status" | "priority" | "attachment" | "sharedFile" | "created" | "createdUser" | "updated" | "updatedUser" | "assignee" | "startDate" | "dueDate" | "estimatedHours" | "actualHours" | "childIssue";
|
||||
export interface GetIssueCommentsParams {
|
||||
minId?: number;
|
||||
maxId?: number;
|
||||
count?: number;
|
||||
order?: Order;
|
||||
}
|
||||
export interface PostIssueCommentsParams {
|
||||
content: string;
|
||||
notifiedUserId?: number[];
|
||||
attachmentId?: number[];
|
||||
}
|
||||
export interface PatchIssueCommentParams {
|
||||
content: string;
|
||||
}
|
||||
export interface IssueCommentNotifications {
|
||||
notifiedUserId: number[];
|
||||
}
|
||||
export interface LinkIssueSharedFilesParams {
|
||||
fileId: number[];
|
||||
}
|
||||
}
|
||||
export namespace PullRequest {
|
||||
export interface GetPullRequestsParams {
|
||||
statusId?: number[];
|
||||
assigneeId?: number[];
|
||||
issueId?: number[];
|
||||
createdUserId?: number[];
|
||||
offset?: number;
|
||||
count?: number;
|
||||
}
|
||||
export interface PostPullRequestParams {
|
||||
summary: string;
|
||||
description: string;
|
||||
base: string;
|
||||
branch: string;
|
||||
issueId?: number;
|
||||
assigneeId?: number;
|
||||
notifiedUserId?: number[];
|
||||
attachmentId?: number[];
|
||||
}
|
||||
export interface PatchPullRequestParams {
|
||||
summary?: string;
|
||||
description?: string;
|
||||
issueId?: number;
|
||||
assigneeId?: number;
|
||||
notifiedUserId?: number[];
|
||||
comment?: string[];
|
||||
}
|
||||
export interface GetPullRequestCommentsParams {
|
||||
minId?: number;
|
||||
maxId?: number;
|
||||
count?: number;
|
||||
order?: Order;
|
||||
}
|
||||
export interface PostPullRequestCommentsParams {
|
||||
content: string;
|
||||
notifiedUserId?: number[];
|
||||
}
|
||||
export interface PatchPullRequestCommentsParams {
|
||||
content: string;
|
||||
}
|
||||
}
|
||||
export namespace Wiki {
|
||||
export interface PostWikiParams {
|
||||
projectId: number;
|
||||
name: string;
|
||||
content: string;
|
||||
mailNotify?: boolean;
|
||||
}
|
||||
export interface PatchWikiParams {
|
||||
name?: string;
|
||||
content?: string;
|
||||
mailNotify?: boolean;
|
||||
}
|
||||
export interface GetWikisHistoryParams {
|
||||
minId?: number;
|
||||
maxId?: number;
|
||||
count?: number;
|
||||
order?: Order;
|
||||
}
|
||||
}
|
||||
export namespace OAuth2 {
|
||||
export interface Credentials {
|
||||
clientId: string;
|
||||
clientSecret: string;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export namespace Error {
|
||||
export class BacklogError extends global.Error {
|
||||
private _name;
|
||||
private _url;
|
||||
private _status;
|
||||
private _body;
|
||||
private _response;
|
||||
constructor(name: BacklogErrorNameType, response: IResponse, body?: {
|
||||
errors: BacklogErrorMessage[];
|
||||
});
|
||||
name: BacklogErrorNameType;
|
||||
url: string;
|
||||
status: number;
|
||||
body: {
|
||||
errors: BacklogErrorMessage[];
|
||||
};
|
||||
response: IResponse;
|
||||
}
|
||||
export class BacklogApiError extends BacklogError {
|
||||
constructor(response: IResponse, body?: {
|
||||
errors: BacklogErrorMessage[];
|
||||
});
|
||||
}
|
||||
export class BacklogAuthError extends BacklogError {
|
||||
constructor(response: IResponse, body?: {
|
||||
errors: BacklogErrorMessage[];
|
||||
});
|
||||
}
|
||||
export class UnexpectedError extends BacklogError {
|
||||
constructor(response: IResponse);
|
||||
}
|
||||
export interface BacklogErrorMessage {
|
||||
message: string;
|
||||
code: number;
|
||||
errorInfo: string;
|
||||
moreInfo: string;
|
||||
}
|
||||
export type BacklogErrorNameType = 'BacklogApiError' | 'BacklogAuthError' | 'UnexpectedError';
|
||||
}
|
||||
|
||||
}
|
||||
@@ -82,6 +82,7 @@ var voidProm: Promise<void>;
|
||||
|
||||
var fooProm: Promise<Foo>;
|
||||
var barProm: Promise<Bar>;
|
||||
var barOrVoidProm: Promise<Bar | void>;
|
||||
var fooOrBarProm: Promise<Foo|Bar>;
|
||||
var bazProm: Promise<Baz>;
|
||||
|
||||
@@ -221,12 +222,12 @@ barProm = fooProm.then((value: Foo) => {
|
||||
}, (reason: any) => {
|
||||
return barProm;
|
||||
});
|
||||
barProm = fooProm.then((value: Foo) => {
|
||||
barOrVoidProm = fooProm.then((value: Foo) => {
|
||||
return bar;
|
||||
}, (reason: any) => {
|
||||
return;
|
||||
});
|
||||
barProm = fooProm.then((value: Foo) => {
|
||||
barOrVoidProm = fooProm.then((value: Foo) => {
|
||||
return bar;
|
||||
}, (reason: any) => {
|
||||
return voidProm;
|
||||
|
||||
Vendored
+4
-2
@@ -47,8 +47,10 @@ class Bluebird<R> implements Bluebird.Thenable<R>, Bluebird.Inspection<R> {
|
||||
/**
|
||||
* Promises/A+ `.then()`. Returns a new promise chained from this promise. The new promise will be rejected or resolved dedefer on the passed `fulfilledHandler`, `rejectedHandler` and the state of this promise.
|
||||
*/
|
||||
then<U>(onFulfill: (value: R) => U | Bluebird.Thenable<U>, onReject?: (error: any) => U | Bluebird.Thenable<U>): Bluebird<U>;
|
||||
then<U>(onFulfill: (value: R) => U | Bluebird.Thenable<U>, onReject?: (error: any) => void | Bluebird.Thenable<void>): Bluebird<U>;
|
||||
then<U1, U2>(onFulfill: (value: R) => U1 | Bluebird.Thenable<U1>, onReject: (error: any) => U2 | Bluebird.Thenable<U2>): Bluebird<U1 | U2>;
|
||||
then<U>(onFulfill: (value: R) => U | Bluebird.Thenable<U>, onReject: (error: any) => U | Bluebird.Thenable<U>): Bluebird<U>;
|
||||
then<U>(onFulfill: (value: R) => U | Bluebird.Thenable<U>): Bluebird<U>;
|
||||
then(): Bluebird<R>;
|
||||
|
||||
/**
|
||||
* This is a catch-all exception handler, shortcut for calling `.then(null, handler)` on this promise. Any exception happening in a `.then`-chain will propagate to nearest `.catch` handler.
|
||||
|
||||
@@ -18,9 +18,19 @@ function test_somethingSyntax() {
|
||||
array.should.include.something.with.property('b', 2);
|
||||
array.should.not.include.something.with.property('b', 3);
|
||||
|
||||
chai.expect(array).to.include.something();
|
||||
chai.expect(array).to.include.something.that.deep.equals({ b: 2 });
|
||||
chai.expect(array).to.include.something.that.not.deep.equals({ b: 2 });
|
||||
chai.expect(array).not.to.include.something.that.deep.equals({ c: 3 });
|
||||
chai.expect(array).to.include.something.that.not.deep.equals({ c: 3 });
|
||||
chai.expect(array).to.include.something.with.property('b', 2);
|
||||
chai.expect(array).not.to.include.something.with.property('b', 3);
|
||||
|
||||
var array2 = [{ a: 'b' }, { a: 'b' }];
|
||||
array2.should.include.something.that.have.property("a");
|
||||
array2.should.include.something.that.have.property("a").not.equal("d");
|
||||
chai.expect(array2).to.include.something.that.have.property("a");
|
||||
chai.expect(array2).to.include.something.that.have.property("a").not.equal("d");
|
||||
}
|
||||
|
||||
function test_somethingVariantsSyntax() {
|
||||
@@ -35,6 +45,16 @@ function test_somethingVariantsSyntax() {
|
||||
array.should.include.one.that.deep.equals({ b: 2 });
|
||||
array.should.include.some();
|
||||
array.should.include.some.that.deep.equal({ b: 2 });
|
||||
|
||||
chai.expect(array).to.include.a.thing();
|
||||
chai.expect(array).to.include.a.thing.that.deep.equals({ b: 2 });
|
||||
chai.expect(array).to.include.an.item();
|
||||
chai.expect(array).to.include.an.item.that.deep.equals({ b: 2 });
|
||||
chai.expect(array).to.include.one.that.deep.equals({ b: 2 });
|
||||
chai.expect(array).to.include.some();
|
||||
chai.expect(array).to.include.some.that.deep.equal({ b: 2 });
|
||||
chai.expect(array).to.contain.a.thing();
|
||||
chai.expect(array).to.contain.a.thing.with.property('a', 1);
|
||||
}
|
||||
|
||||
function test_allSyntax() {
|
||||
|
||||
Vendored
+9
@@ -23,6 +23,15 @@ declare namespace Chai {
|
||||
any: Anything;
|
||||
}
|
||||
|
||||
interface Include {
|
||||
(item: any): any;
|
||||
a: Item;
|
||||
an: Item;
|
||||
one: Something;
|
||||
some: Something;
|
||||
something: Something;
|
||||
}
|
||||
|
||||
interface Anything extends Assertion {
|
||||
(): any;
|
||||
that: Assertion;
|
||||
|
||||
@@ -3,9 +3,15 @@
|
||||
|
||||
import colors = require("colors");
|
||||
|
||||
colors.enabled = true;
|
||||
|
||||
console.log(colors.black.underline('test'));
|
||||
console.log(colors.rainbow.black.blue.gray('test'));
|
||||
console.log(colors.random.reset.bgWhite.dim('test'));
|
||||
console.log('test'.black.underline);
|
||||
console.log('test'.rainbow.black.blue.gray);
|
||||
console.log('test'.random.reset.bgWhite.dim);
|
||||
|
||||
colors.enabled = false;
|
||||
|
||||
console.log(colors.black.underline('test'));
|
||||
|
||||
Vendored
+2
@@ -47,6 +47,8 @@ declare module "colors" {
|
||||
namespace e {
|
||||
export function setTheme(theme:any): void;
|
||||
|
||||
export var enabled: boolean;
|
||||
|
||||
export var black: Color;
|
||||
export var red: Color;
|
||||
export var green: Color;
|
||||
|
||||
@@ -1,30 +1,32 @@
|
||||
/// <reference path="cucumber.d.ts" />
|
||||
/// <reference path="../assert/assert.d.ts" />
|
||||
|
||||
function StepSample() {
|
||||
type Callback = cucumber.CallbackStepDefinition;
|
||||
type Table = cucumber.TableDefinition;
|
||||
var step = <cucumber.StepDefinitions>this;
|
||||
var hook = <cucumber.Hooks>this;
|
||||
|
||||
|
||||
hook.Before(function(scenario, callback){
|
||||
scenario.isFailed() && callback.pending();
|
||||
})
|
||||
|
||||
|
||||
hook.Around(function(scenario, runScenario) {
|
||||
scenario.isFailed() && runScenario(null, function(){
|
||||
console.log('finish tasks');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
hook.registerHandler('AfterFeatures', function (event, callback) {
|
||||
callback();
|
||||
});
|
||||
|
||||
|
||||
step.Given(/^I am on the Cucumber.js GitHub repository$/, function(callback:Callback) {
|
||||
this.visit('https://github.com/cucumber/cucumber-js', callback);
|
||||
});
|
||||
|
||||
step.When(/^I go to the README file$/, function(title:string, callback:Callback) {
|
||||
callback.pending();
|
||||
callback(null, 'pending');
|
||||
});
|
||||
|
||||
step.Then(/^I should see "(.*)" as the page title$/, { timeout:60*1000}, function(title:string, callback:Callback) {
|
||||
@@ -36,5 +38,43 @@ function StepSample() {
|
||||
callback(new Error("Expected to be on page with title " + title));
|
||||
}
|
||||
});
|
||||
|
||||
// Type for data_table.js on
|
||||
// https://github.com/cucumber/cucumber-js/blob/a5fd8251918c278ab2e389226d165cedb44df14a/lib/cucumber/ast/data_table.js
|
||||
|
||||
step.Given(/^a table step with Table raw$/, function(table:Table){
|
||||
var expected = [
|
||||
['Cucumber', 'Cucumis sativus'],
|
||||
['Burr Gherkin', 'Cucumis anguria']
|
||||
];
|
||||
|
||||
assert.deepEqual(table.raw(), expected);
|
||||
});
|
||||
|
||||
step.Given(/^a table step with Table rows$/, function(table: Table){
|
||||
var expected = [
|
||||
['Apricot', '5'],
|
||||
['Brocolli', '2'],
|
||||
['Cucumber', '10']
|
||||
];
|
||||
assert.deepEqual(table.rows(), expected)
|
||||
});
|
||||
|
||||
step.Given(/^a table step with Table rowHash$/, function(table:Table){
|
||||
var expected = {
|
||||
'Cucumber': 'Cucumis sativus',
|
||||
'Burr Gherkin': 'Cucumis anguria'
|
||||
};
|
||||
assert.deepEqual(table.rowsHash(), expected)
|
||||
});
|
||||
|
||||
step.Given(/^a table step$/, function(table:Table){
|
||||
var expected = [
|
||||
{'Vegetable': 'Apricot', 'Rating': '5'},
|
||||
{'Vegetable': 'Brocolli', 'Rating': '2'},
|
||||
{'Vegetable': 'Cucumber', 'Rating': '10'}
|
||||
];
|
||||
assert.deepEqual(table.hashes(), expected)
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Vendored
+11
-2
@@ -7,11 +7,20 @@ declare namespace cucumber {
|
||||
|
||||
export interface CallbackStepDefinition{
|
||||
pending : () => PromiseLike<any>;
|
||||
(errror?:any):void;
|
||||
(errror?:any, pending?: string):void;
|
||||
}
|
||||
|
||||
export interface TableDefinition{
|
||||
raw: () => Array<any>;
|
||||
rows: () => Array<any>;
|
||||
rowsHash: () => {};
|
||||
hashes: () => {};
|
||||
}
|
||||
|
||||
type StepDefinitionParam = string | CallbackStepDefinition | TableDefinition;
|
||||
|
||||
interface StepDefinitionCode {
|
||||
(...stepArgs: Array<string |CallbackStepDefinition>): PromiseLike<any> | any | void;
|
||||
(...stepArgs: Array<StepDefinitionParam>): PromiseLike<any> | any | void;
|
||||
}
|
||||
|
||||
interface StepDefinitionOptions{
|
||||
|
||||
Vendored
+5
-3
@@ -297,7 +297,7 @@ declare namespace d3 {
|
||||
* @param value the function to compute data for each node
|
||||
*/
|
||||
datum<NewDatum>(value: (datum: Datum, index: number, outerIndex: number) => NewDatum): Update<NewDatum>;
|
||||
|
||||
|
||||
/**
|
||||
* Set the data item for each node in the selection.
|
||||
* @param value the constant element to use for each node
|
||||
@@ -415,7 +415,7 @@ declare namespace d3 {
|
||||
|
||||
select(name: (datum: Datum, index: number, outerIndex: number) => EventTarget): Selection<Datum>;
|
||||
call(func: (selection: Enter<Datum>, ...args: any[]) => any, ...args: any[]): Enter<Datum>;
|
||||
|
||||
|
||||
empty(): boolean;
|
||||
size(): number;
|
||||
}
|
||||
@@ -1078,7 +1078,7 @@ declare namespace d3 {
|
||||
* Return the min and max simultaneously.
|
||||
*/
|
||||
export function extent<T>(array: T[], accessor: (datum: T, index: number) => string): [string, string];
|
||||
|
||||
|
||||
/**
|
||||
* Return the min and max simultaneously.
|
||||
*/
|
||||
@@ -2928,6 +2928,8 @@ declare namespace d3 {
|
||||
|
||||
start(): Force<Link, Node>;
|
||||
|
||||
tick(): Force<Link, Node>;
|
||||
|
||||
alpha(): number;
|
||||
alpha(value: number): Force<Link, Node>;
|
||||
|
||||
|
||||
Vendored
+17
-1
@@ -5686,7 +5686,23 @@ declare namespace dojo {
|
||||
* @param dest The object to which to copy/add all properties contained in source. If dest is falsy, thena new object is manufactured before copying/adding properties begins.
|
||||
* @param sources One of more objects from which to draw all properties to copy into dest. sources are processedleft-to-right and if more than one of these objects contain the same property name, the right-mostvalue "wins".
|
||||
*/
|
||||
mixin(dest: Object, source: Object, sources?: Object[]): Object;
|
||||
mixin<T>(dest: T): T;
|
||||
mixin<T, U>(
|
||||
dest: T,
|
||||
source: U
|
||||
): T & U;
|
||||
mixin<T, U, V>(
|
||||
dest: T,
|
||||
source1: U,
|
||||
source2: V
|
||||
): T & U & V;
|
||||
mixin<T, U, V, W>(
|
||||
dest: T,
|
||||
source1: U,
|
||||
source2: V,
|
||||
source3: W
|
||||
): T & U & V & W;
|
||||
mixin<T>(dest: Object, ...sources: Object[]): T;
|
||||
/**
|
||||
* similar to hitch() except that the scope object is left to be
|
||||
* whatever the execution context eventually becomes.
|
||||
|
||||
Vendored
+210
-210
File diff suppressed because it is too large
Load Diff
Vendored
+2
-1
@@ -79,8 +79,9 @@ declare module "fs-extra" {
|
||||
export interface CopyOptions {
|
||||
clobber?: boolean
|
||||
preserveTimestamps?: boolean
|
||||
dereference?: boolean
|
||||
dereference?: boolean
|
||||
filter?: CopyFilter
|
||||
recursive?: boolean
|
||||
}
|
||||
|
||||
export interface OpenOptions {
|
||||
|
||||
Vendored
+9
-7
@@ -25,15 +25,17 @@ declare namespace FullCalendar {
|
||||
end: moment.Moment;
|
||||
}
|
||||
|
||||
export interface Header {
|
||||
left: string;
|
||||
center: string;
|
||||
right: string;
|
||||
}
|
||||
|
||||
export interface Options extends AgendaOptions, EventDraggingResizingOptions, DroppingExternalElementsOptions, SelectionOptions {
|
||||
// General display - http://fullcalendar.io/docs/display/
|
||||
|
||||
header?: {
|
||||
left: string;
|
||||
center: string;
|
||||
right: string;
|
||||
}
|
||||
theme?: boolean
|
||||
header?: boolean | Header;
|
||||
theme?: boolean;
|
||||
buttonIcons?: {
|
||||
prev: string;
|
||||
next: string;
|
||||
@@ -50,7 +52,7 @@ declare namespace FullCalendar {
|
||||
contentHeight?: number;
|
||||
aspectRatio?: number;
|
||||
handleWindowResize?: boolean;
|
||||
views?: ViewSpecificOptions;
|
||||
views?: ViewSpecificOptions;
|
||||
viewRender?: (view: ViewObject, element: JQuery) => void;
|
||||
viewDestroy?: (view: ViewObject, element: JQuery) => void;
|
||||
dayRender?: (date: Date, cell: HTMLTableDataCellElement) => void;
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
/// <reference path="geojson2osm.d.ts" />
|
||||
/// <reference path="../geojson/geojson.d.ts" />
|
||||
|
||||
import { geojson2osm } from 'geojson2osm'
|
||||
|
||||
const features: GeoJSON.FeatureCollection<any> = {
|
||||
type: 'FeatureCollection',
|
||||
features: [{
|
||||
type: 'Feature',
|
||||
properties: {
|
||||
'building:colour': '#9F8169',
|
||||
'building:levels': 21,
|
||||
building: 'yes',
|
||||
height: 57,
|
||||
},
|
||||
geometry: {
|
||||
type: 'Polygon',
|
||||
coordinates: [
|
||||
[
|
||||
[
|
||||
-434.2249470949173,
|
||||
-13.15996269397843,
|
||||
],
|
||||
[
|
||||
-434.2249470949173,
|
||||
-13.159751140560356,
|
||||
],
|
||||
[
|
||||
-434.2242631316185,
|
||||
-13.159751140560356,
|
||||
],
|
||||
[
|
||||
-434.2242631316185,
|
||||
-13.15996269397843,
|
||||
],
|
||||
[
|
||||
-434.2249470949173,
|
||||
-13.15996269397843,
|
||||
],
|
||||
],
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
}
|
||||
|
||||
geojson2osm(features)
|
||||
Vendored
+15
@@ -0,0 +1,15 @@
|
||||
// Type definitions for geojson2osm 0.0.5
|
||||
// Project: https://github.com/Rub21/geojson2osm
|
||||
// Definitions by: Denis Carriere <https://github.com/DenisCarriere>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference path="../geojson/geojson.d.ts" />
|
||||
|
||||
declare module 'geojson2osm' {
|
||||
/**
|
||||
* Converts GeoJSON features to OpenStreetMap XML.
|
||||
* @param features Input features
|
||||
* @returns OpenStreetMap XML
|
||||
*/
|
||||
export function geojson2osm(features: GeoJSON.Feature<any> | GeoJSON.FeatureCollection<any>): any
|
||||
}
|
||||
Vendored
+1
@@ -61,6 +61,7 @@ declare namespace google.maps {
|
||||
backgroundColor?: string;
|
||||
center?: LatLng|LatLngLiteral;
|
||||
disableDefaultUI?: boolean;
|
||||
clickableIcons?: boolean;
|
||||
disableDoubleClickZoom?: boolean;
|
||||
draggable?: boolean;
|
||||
draggableCursor?: string;
|
||||
|
||||
Vendored
+4
-2
@@ -5,9 +5,11 @@
|
||||
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
/// <reference path="../orchestrator/orchestrator.d.ts" />
|
||||
/// <reference path="../vinyl/vinyl.d.ts" />
|
||||
|
||||
declare module "gulp" {
|
||||
import Orchestrator = require("orchestrator");
|
||||
import VinylFile = require("vinyl");
|
||||
|
||||
namespace gulp {
|
||||
interface Gulp extends Orchestrator {
|
||||
@@ -92,7 +94,7 @@ declare module "gulp" {
|
||||
* @param outFolder The path (output folder) to write files to. Or a function that returns it, the function will be provided a vinyl File instance.
|
||||
* @param opt
|
||||
*/
|
||||
(outFolder: string|((file: string) => string), opt?: DestOptions): NodeJS.ReadWriteStream;
|
||||
(outFolder: string|((file: VinylFile) => string), opt?: DestOptions): NodeJS.ReadWriteStream;
|
||||
}
|
||||
|
||||
interface SrcMethod {
|
||||
@@ -149,7 +151,7 @@ declare module "gulp" {
|
||||
* Note that an explicit dot in a portion of the pattern will always match dot files.
|
||||
*/
|
||||
dot?: boolean;
|
||||
|
||||
|
||||
/**
|
||||
* Set to match only fles, not directories. Set this flag to prevent copying empty directories
|
||||
*/
|
||||
|
||||
@@ -176,6 +176,7 @@ class IonicTestController {
|
||||
var currentStateName: string = this.$ionicHistory.currentStateName();
|
||||
|
||||
this.$ionicHistory.goBack(5);
|
||||
this.$ionicHistory.removeBackView();
|
||||
this.$ionicHistory.clearHistory();
|
||||
this.$ionicHistory.clearCache().then(() => console.log("done clearing cache!"));
|
||||
this.$ionicHistory.nextViewOptions({
|
||||
|
||||
Vendored
+1
@@ -213,6 +213,7 @@ declare namespace ionic {
|
||||
currentStateName(): string;
|
||||
|
||||
goBack(backCount?: number): void;
|
||||
removeBackView(): void;
|
||||
clearHistory(): void;
|
||||
clearCache(): angular.IPromise<any>;
|
||||
nextViewOptions(options: IonicHistoryNextViewOptions): void;
|
||||
|
||||
Vendored
+4
@@ -197,6 +197,8 @@ declare module IORedis {
|
||||
hmget(...args: any[]): any;
|
||||
hincrby(args: any[], callback?: ResCallbackT<any>): any;
|
||||
hincrby(...args: any[]): any;
|
||||
hincrbyfloat(args: any[], callback?: ResCallbackT<any>): any;
|
||||
hincrbyfloat(...args: any[]): any;
|
||||
hdel(args: any[], callback?: ResCallbackT<any>): any;
|
||||
hdel(...args: any[]): any;
|
||||
hlen(args: any[], callback?: ResCallbackT<any>): any;
|
||||
@@ -478,6 +480,8 @@ declare module IORedis {
|
||||
hmget(...args: any[]): Pipeline;
|
||||
hincrby(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
hincrby(...args: any[]): Pipeline;
|
||||
hincrbyfloat(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
hincrbyfloat(...args: any[]): Pipeline;
|
||||
hdel(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
hdel(...args: any[]): Pipeline;
|
||||
hlen(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
|
||||
@@ -752,6 +752,10 @@ schema = Joi.alternatives(schema, anySchema, boolSchema);
|
||||
|
||||
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
||||
|
||||
schema = Joi.lazy(() => schema)
|
||||
|
||||
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
||||
|
||||
Joi.validate(value, obj);
|
||||
Joi.validate(value, schema);
|
||||
Joi.validate(value, schema, validOpts);
|
||||
|
||||
Vendored
+7
@@ -816,6 +816,13 @@ declare module 'joi' {
|
||||
export function alternatives(): AlternativesSchema;
|
||||
export function alternatives(types: Schema[]): AlternativesSchema;
|
||||
export function alternatives(type1: Schema, type2: Schema, ...types: Schema[]): AlternativesSchema;
|
||||
|
||||
/**
|
||||
* Generates a placeholder schema for a schema that you would provide with the fn.
|
||||
* Supports the same methods of the any() type.
|
||||
* This is mostly useful for recursive schemas
|
||||
*/
|
||||
export function lazy(cb: () => Schema): Schema;
|
||||
|
||||
/**
|
||||
* Validates a value using the given schema and options.
|
||||
|
||||
@@ -9,7 +9,7 @@ class Tests {
|
||||
run(): void {
|
||||
const self = this;
|
||||
|
||||
var t = QUnit.test;
|
||||
let t = QUnit.test;
|
||||
|
||||
QUnit.begin(() => {
|
||||
|
||||
@@ -36,7 +36,7 @@ class Tests {
|
||||
responseText: 'Hello Word'
|
||||
});
|
||||
|
||||
var xhr = $.ajax({
|
||||
let xhr = $.ajax({
|
||||
url: '/xmlhttprequest',
|
||||
complete: () => { }
|
||||
});
|
||||
@@ -67,7 +67,7 @@ class Tests {
|
||||
});
|
||||
|
||||
t('Intercept asynchronized proxy calls', (assert) => {
|
||||
var done = assert.async();
|
||||
let done = assert.async();
|
||||
$.mockjax({
|
||||
url: '/proxy',
|
||||
proxy: 'test_proxy.json'
|
||||
@@ -85,7 +85,7 @@ class Tests {
|
||||
});
|
||||
|
||||
t('Intercept and proxy (sub-ajax request)', (assert) => {
|
||||
var done = assert.async();
|
||||
let done = assert.async();
|
||||
|
||||
$.mockjax({
|
||||
url: '/proxy',
|
||||
@@ -104,7 +104,7 @@ class Tests {
|
||||
});
|
||||
|
||||
t('Proxy type specification', (assert) => {
|
||||
var done = assert.async();
|
||||
let done = assert.async();
|
||||
|
||||
$.mockjax({
|
||||
url: '/proxy',
|
||||
@@ -124,7 +124,7 @@ class Tests {
|
||||
});
|
||||
|
||||
t('Support 1.5 $.ajax(url, settings) signature.', (assert) => {
|
||||
var done = assert.async();
|
||||
let done = assert.async();
|
||||
|
||||
$.mockjax({
|
||||
url: '/resource',
|
||||
@@ -141,9 +141,9 @@ class Tests {
|
||||
});
|
||||
|
||||
t('Dynamic response callback', (assert) => {
|
||||
var done = assert.async();
|
||||
let done = assert.async();
|
||||
|
||||
var settings: MockJaxSettings = {
|
||||
let settings: MockJaxSettings = {
|
||||
url: '/response-callback',
|
||||
response: (settings) => {
|
||||
settings.responseText = settings.data.response + ' 2';
|
||||
@@ -165,8 +165,36 @@ class Tests {
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
t('Asyncronous response callback', (assert) => {
|
||||
let done = assert.async();
|
||||
|
||||
let settings: MockJaxSettings = {
|
||||
url: '/async-response-callback',
|
||||
response: (settings, completed) => {
|
||||
setTimeout(() => {
|
||||
settings.responseText = settings.data.response + ' 3';
|
||||
completed();
|
||||
}, 10);
|
||||
}
|
||||
};
|
||||
|
||||
$.mockjax(settings);
|
||||
|
||||
$.ajax({
|
||||
url: '/async-response-callback',
|
||||
dataType: 'text',
|
||||
data: {
|
||||
response: 'Hello world'
|
||||
},
|
||||
error: self._noErrorCallbackExpected,
|
||||
complete: (xhr) => {
|
||||
assert.equal(xhr.responseText, 'Hello world 3', 'Response Text matches');
|
||||
done();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
var tests = new Tests();
|
||||
tests.run();
|
||||
new Tests().run();
|
||||
|
||||
Vendored
+1
-1
@@ -22,7 +22,7 @@ interface MockJaxSettings {
|
||||
isTimeout?: boolean;
|
||||
dataType?: string;
|
||||
contentType?: string;
|
||||
response?: (settings: any) => void;
|
||||
response?: (settings: any, done?: Function) => void;
|
||||
responseText?: string | Object;
|
||||
responseXml?: string;
|
||||
proxy?: string;
|
||||
|
||||
@@ -1,9 +1,15 @@
|
||||
/// <reference path="./../axios/axios.d.ts" />
|
||||
/// <reference path="js-data-http.d.ts" />
|
||||
|
||||
import * as axios from 'axios';
|
||||
|
||||
var adapter = new DSHttpAdapter();
|
||||
var store = new JSData.DS();
|
||||
store.registerAdapter('http', adapter, { default: true });
|
||||
|
||||
adapter.defaults.basePath = '/api';
|
||||
adapter.http = axios;
|
||||
|
||||
var ADocument:JSData.DSResourceDefinition<any> = store.defineResource<any>('document');
|
||||
|
||||
ADocument.inject({ id: 5, author: 'John' });
|
||||
|
||||
Vendored
+5
@@ -15,6 +15,8 @@ declare namespace JSData {
|
||||
forceTrailingSlash?: boolean;
|
||||
log?: boolean | ((message?:any, ...optionalParams:any[])=> void);
|
||||
error?: boolean | ((message?:any, ...optionalParams:any[])=> void);
|
||||
basePath?: string;
|
||||
verbsUseBasePath?: string;
|
||||
}
|
||||
|
||||
interface DSHttpAdapterPromiseResolveType {
|
||||
@@ -28,6 +30,9 @@ declare namespace JSData {
|
||||
|
||||
new(options?:DSHttpAdapterOptions):DSHttpAdapter;
|
||||
|
||||
defaults: DSHttpAdapterOptions;
|
||||
http: any;
|
||||
|
||||
// DSHttpAdapter uses axios so options are axios config objects.
|
||||
HTTP(options?:Object):JSDataPromise<DSHttpAdapterPromiseResolveType>;
|
||||
DEL(url:string, data?:Object, options?:Object):JSDataPromise<DSHttpAdapterPromiseResolveType>;
|
||||
|
||||
@@ -600,3 +600,5 @@ customActionResource.emit("DS.change", customActionResource, customActionResourc
|
||||
customActionResourceInstance.on("DS.change", myEvtHandler);
|
||||
customActionResourceInstance.off("DS.change", myEvtHandler);
|
||||
customActionResourceInstance.emit("DS.change", customActionResource, customActionResourceInstance);
|
||||
|
||||
JSData.DSUtils.Promise = Promise;
|
||||
Vendored
+1
@@ -342,6 +342,7 @@ declare namespace JSData {
|
||||
declare var JSData:{
|
||||
DS: JSData.DS;
|
||||
DSErrors: JSData.DSErrors;
|
||||
DSUtils: any;
|
||||
};
|
||||
|
||||
//Support node require
|
||||
|
||||
Vendored
+1
@@ -68,6 +68,7 @@ declare module "jsdom" {
|
||||
export function createCookieJar(): CookieJar;
|
||||
export function nodeLocation(node: Node): any;
|
||||
export function reconfigureWindow(window: Window, newProps: WindowProperties): void;
|
||||
export function changeURL(window: Window, url: string): void;
|
||||
|
||||
export function jQueryify(window: Window, jqueryUrl: string, callback: (window: Window, jquery: JQuery) => any): void;
|
||||
|
||||
|
||||
+4
-1
@@ -1,4 +1,7 @@
|
||||
/// <reference path="jsts.d.ts" />
|
||||
|
||||
import * as jsts from 'jsts';
|
||||
|
||||
var str: string;
|
||||
var n: number;
|
||||
var bool: boolean;
|
||||
@@ -142,4 +145,4 @@ obj = gjw.write(g);
|
||||
|
||||
var wr: jsts.io.WKTReader = new jsts.io.WKTReader();
|
||||
g = wr.read(str);
|
||||
wr.reducePrecision(g);
|
||||
wr.reducePrecision(g);
|
||||
|
||||
Vendored
+4
@@ -1664,3 +1664,7 @@ declare namespace jsts {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
declare module "jsts" {
|
||||
export = jsts;
|
||||
}
|
||||
|
||||
Vendored
+1
@@ -37,5 +37,6 @@ declare module "koa-compress" {
|
||||
*/
|
||||
function compress(options?: CompressOptions): { (ctx: Koa.Context, next?: () => any): any };
|
||||
|
||||
namespace compress {}
|
||||
export = compress;
|
||||
}
|
||||
|
||||
Vendored
+1
@@ -31,5 +31,6 @@ declare module "koa-favicon" {
|
||||
|
||||
}): { (ctx: Koa.Context, next?: () => any): any };
|
||||
|
||||
namespace favicon {}
|
||||
export = favicon;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
/// <reference path="../koa/koa.d.ts" />
|
||||
/// <reference path="koa-json-error.d.ts" />
|
||||
/// <reference path="../lodash/lodash.d.ts" />
|
||||
|
||||
import * as Koa from "koa";
|
||||
import * as error from "koa-json-error";
|
||||
import { assign } from "lodash";
|
||||
|
||||
const app = new Koa();
|
||||
|
||||
app.use(error({
|
||||
preFormat: err => assign({}, err)
|
||||
}));
|
||||
Vendored
+36
@@ -0,0 +1,36 @@
|
||||
// Type definitions for koa-json-error v3.x
|
||||
// Project: https://github.com/koajs/json-error
|
||||
// Definitions by: Mudkip <https://github.com/mudkipme>
|
||||
// Definitions: https://github.com/mudkipme/DefinitelyTyped
|
||||
|
||||
/// <reference path="../koa/koa.d.ts" />
|
||||
|
||||
declare module "koa-json-error" {
|
||||
|
||||
import * as Koa from "koa";
|
||||
|
||||
interface JSONErrorOptions {
|
||||
/**
|
||||
* Perform some task before calling `options.format`. Must be a function with the original err as its only argument.
|
||||
*/
|
||||
preFormat?: { (err: Error): any };
|
||||
|
||||
/**
|
||||
* Runs inmediatly after `options.preFormat`. It receives two arguments: the original `err` and the output of `options.preFormat`. It should `return` a newly formatted error.
|
||||
*/
|
||||
format?: { (err: Error, obj: any): any };
|
||||
|
||||
/**
|
||||
* Runs inmediatly after `options.format`. It receives two arguments: the original `err` and the output of `options.format`. It should `return` a newly formatted error.
|
||||
*/
|
||||
postFormat?: { (err: Error, obj: any): any };
|
||||
}
|
||||
|
||||
/**
|
||||
* Error handler for pure Koa 2.0.0+ JSON apps
|
||||
*/
|
||||
function jsonError(options?: JSONErrorOptions) : { (ctx: Koa.Context, next?: () => any): any };
|
||||
|
||||
namespace jsonError {}
|
||||
export = jsonError;
|
||||
}
|
||||
@@ -23,11 +23,11 @@ router
|
||||
.put('/users/:id', function (ctx, next) {
|
||||
ctx.body = ctx.params.id;
|
||||
})
|
||||
.del('/users/:id', function (ctx, next) {
|
||||
.del('/users/:id', function () {
|
||||
// ...
|
||||
});
|
||||
|
||||
router.get('user', '/users/:id', function (ctx, next) {
|
||||
router.get('user', '/users/:id', function (ctx) {
|
||||
ctx.body = "sdsd";
|
||||
});
|
||||
|
||||
|
||||
Vendored
+26
-28
@@ -49,11 +49,11 @@ declare module "koa-router" {
|
||||
}
|
||||
|
||||
export interface IMiddleware {
|
||||
(ctx: Router.IRouterContext, next?: () => any): any;
|
||||
(ctx: Router.IRouterContext, next: () => Promise<any>): any;
|
||||
}
|
||||
|
||||
export interface IParamMiddleware {
|
||||
(param: string, ctx: Router.IRouterContext, next?: () => any): any;
|
||||
(param: string, ctx: Router.IRouterContext, next: () => Promise<any>): any;
|
||||
}
|
||||
|
||||
export interface IRouterAllowedMethodsOptions {
|
||||
@@ -83,10 +83,8 @@ declare module "koa-router" {
|
||||
regexp: RegExp;
|
||||
path: string;
|
||||
|
||||
constructor(path: string, methods: string[], middleware: Router.IMiddleware, opts?: Layer.ILayerOptions);
|
||||
constructor(path: string, methods: string[], middleware: Array<Router.IMiddleware>, opts?: Layer.ILayerOptions);
|
||||
constructor(path: RegExp, methods: string[], middleware: Router.IMiddleware, opts?: Layer.ILayerOptions);
|
||||
constructor(path: RegExp, methods: string[], middleware: Array<Router.IMiddleware>, opts?: Layer.ILayerOptions);
|
||||
constructor(path: string | RegExp, methods: string[], middleware: Router.IMiddleware, opts?: Layer.ILayerOptions);
|
||||
constructor(path: string | RegExp, methods: string[], middleware: Array<Router.IMiddleware>, opts?: Layer.ILayerOptions);
|
||||
|
||||
/**
|
||||
* Returns whether request `path` matches route.
|
||||
@@ -96,7 +94,7 @@ declare module "koa-router" {
|
||||
/**
|
||||
* Returns map of URL parameters for given `path` and `paramNames`.
|
||||
*/
|
||||
params(path: string, captures: string[], existingParams?: Object): Object;
|
||||
params(path: string | RegExp, captures: string[], existingParams?: Object): Object;
|
||||
|
||||
/**
|
||||
* Returns array of regexp url path captures.
|
||||
@@ -138,61 +136,61 @@ declare module "koa-router" {
|
||||
* "down" the middleware stack.
|
||||
*/
|
||||
use(...middleware: Array<Router.IMiddleware>): Router;
|
||||
use(path: string, ...middleware: Array<Router.IMiddleware>): Router;
|
||||
use(path: string | RegExp, ...middleware: Array<Router.IMiddleware>): Router;
|
||||
|
||||
/**
|
||||
* HTTP get method
|
||||
*/
|
||||
get(name: string, path: string, ...middleware: Array<Router.IMiddleware>): Router;
|
||||
get(path: string, ...middleware: Array<Router.IMiddleware>): Router;
|
||||
get(name: string, path: string | RegExp, ...middleware: Array<Router.IMiddleware>): Router;
|
||||
get(path: string | RegExp, ...middleware: Array<Router.IMiddleware>): Router;
|
||||
|
||||
/**
|
||||
* HTTP post method
|
||||
*/
|
||||
post(name: string, path: string, ...middleware: Array<Router.IMiddleware>): Router;
|
||||
post(path: string, ...middleware: Array<Router.IMiddleware>): Router;
|
||||
post(name: string, path: string | RegExp, ...middleware: Array<Router.IMiddleware>): Router;
|
||||
post(path: string | RegExp, ...middleware: Array<Router.IMiddleware>): Router;
|
||||
|
||||
/**
|
||||
* HTTP put method
|
||||
*/
|
||||
put(name: string, path: string, ...middleware: Array<Router.IMiddleware>): Router;
|
||||
put(path: string, ...middleware: Array<Router.IMiddleware>): Router;
|
||||
put(name: string, path: string | RegExp, ...middleware: Array<Router.IMiddleware>): Router;
|
||||
put(path: string | RegExp, ...middleware: Array<Router.IMiddleware>): Router;
|
||||
|
||||
/**
|
||||
* HTTP delete method
|
||||
*/
|
||||
delete(name: string, path: string, ...middleware: Array<Router.IMiddleware>): Router;
|
||||
delete(path: string, ...middleware: Array<Router.IMiddleware>): Router;
|
||||
delete(name: string, path: string | RegExp, ...middleware: Array<Router.IMiddleware>): Router;
|
||||
delete(path: string | RegExp, ...middleware: Array<Router.IMiddleware>): Router;
|
||||
|
||||
/**
|
||||
* Alias for `router.delete()` because delete is a reserved word
|
||||
*/
|
||||
del(name: string, path: string, ...middleware: Array<Router.IMiddleware>): Router;
|
||||
del(path: string, ...middleware: Array<Router.IMiddleware>): Router;
|
||||
del(name: string, path: string | RegExp, ...middleware: Array<Router.IMiddleware>): Router;
|
||||
del(path: string | RegExp, ...middleware: Array<Router.IMiddleware>): Router;
|
||||
|
||||
/**
|
||||
* HTTP head method
|
||||
*/
|
||||
head(name: string, path: string, ...middleware: Array<Router.IMiddleware>): Router;
|
||||
head(path: string, ...middleware: Array<Router.IMiddleware>): Router;
|
||||
head(name: string, path: string | RegExp, ...middleware: Array<Router.IMiddleware>): Router;
|
||||
head(path: string | RegExp, ...middleware: Array<Router.IMiddleware>): Router;
|
||||
|
||||
/**
|
||||
* HTTP options method
|
||||
*/
|
||||
options(name: string, path: string, ...middleware: Array<Router.IMiddleware>): Router;
|
||||
options(path: string, ...middleware: Array<Router.IMiddleware>): Router;
|
||||
options(name: string, path: string | RegExp, ...middleware: Array<Router.IMiddleware>): Router;
|
||||
options(path: string | RegExp, ...middleware: Array<Router.IMiddleware>): Router;
|
||||
|
||||
/**
|
||||
* HTTP path method
|
||||
*/
|
||||
patch(name: string, path: string, ...middleware: Array<Router.IMiddleware>): Router;
|
||||
patch(path: string, ...middleware: Array<Router.IMiddleware>): Router;
|
||||
patch(name: string, path: string | RegExp, ...middleware: Array<Router.IMiddleware>): Router;
|
||||
patch(path: string | RegExp, ...middleware: Array<Router.IMiddleware>): Router;
|
||||
|
||||
/**
|
||||
* Register route with all methods.
|
||||
*/
|
||||
all(name: string, path: string, ...middleware: Array<Router.IMiddleware>): Router;
|
||||
all(path: string, ...middleware: Array<Router.IMiddleware>): Router;
|
||||
all(name: string, path: string | RegExp, ...middleware: Array<Router.IMiddleware>): Router;
|
||||
all(path: string | RegExp, ...middleware: Array<Router.IMiddleware>): Router;
|
||||
|
||||
/**
|
||||
* Set the path prefix for a Router instance that was already initialized.
|
||||
@@ -226,7 +224,7 @@ declare module "koa-router" {
|
||||
/**
|
||||
* Create and register a route.
|
||||
*/
|
||||
register(path: string, methods: string[], middleware: Router.IMiddleware, opts?: Object): Layer;
|
||||
register(path: string | RegExp, methods: string[], middleware: Router.IMiddleware, opts?: Object): Layer;
|
||||
|
||||
/**
|
||||
* Lookup route with given `name`.
|
||||
@@ -254,7 +252,7 @@ declare module "koa-router" {
|
||||
/**
|
||||
* Generate URL from url pattern and given `params`.
|
||||
*/
|
||||
static url(path: string, params: Object): string;
|
||||
static url(path: string | RegExp, params: Object): string;
|
||||
}
|
||||
|
||||
export = Router;
|
||||
|
||||
@@ -1,48 +1,48 @@
|
||||
// test file for masonry-layout.d.ts
|
||||
|
||||
/// <reference path="../jquery/jquery.d.ts" />
|
||||
/// <reference path="./masonry-layout.d.ts" />
|
||||
|
||||
//import {Masonry} from "./masonry-layout.d.ts";
|
||||
|
||||
// responsive layouts
|
||||
function testResponsiveLayouts() {
|
||||
$('.grid').masonry({
|
||||
itemSelector: '.grid-item',
|
||||
columnWidth: '.grid-sizer',
|
||||
percentPosition: true
|
||||
});
|
||||
}
|
||||
|
||||
// recommended Options
|
||||
function testRecommendedOptions() {
|
||||
$('.grid').masonry({
|
||||
columnWidth: 200,
|
||||
itemSelector: '.grid-item'
|
||||
});
|
||||
|
||||
var msnry = new Masonry.Masonry('.grid', {
|
||||
columnWidth: 200,
|
||||
itemSelector: '.grid-item'
|
||||
});
|
||||
}
|
||||
|
||||
// extended Options
|
||||
function testExtendedOptions() {
|
||||
var msnry = new Masonry.Masonry('.grid', {
|
||||
itemSelector: '.grid-item',
|
||||
columnWidth: '.grid-sizer',
|
||||
percentPosition: true,
|
||||
gutter: '.gutter-sizer',
|
||||
stamp: '.stamp',
|
||||
fitWidth: true,
|
||||
originLeft: true,
|
||||
originTop: true,
|
||||
containerStyle: {
|
||||
position: 'relative'
|
||||
},
|
||||
transitionDuration: '0.4s',
|
||||
resize: true,
|
||||
initLayout: true
|
||||
});
|
||||
}
|
||||
// test file for masonry-layout.d.ts
|
||||
|
||||
/// <reference path="../jquery/jquery.d.ts" />
|
||||
/// <reference path="./masonry-layout.d.ts" />
|
||||
|
||||
//import {Masonry} from "./masonry-layout.d.ts";
|
||||
|
||||
// responsive layouts
|
||||
function testResponsiveLayouts() {
|
||||
$('.grid').masonry({
|
||||
itemSelector: '.grid-item',
|
||||
columnWidth: '.grid-sizer',
|
||||
percentPosition: true
|
||||
});
|
||||
}
|
||||
|
||||
// recommended Options
|
||||
function testRecommendedOptions() {
|
||||
$('.grid').masonry({
|
||||
columnWidth: 200,
|
||||
itemSelector: '.grid-item'
|
||||
});
|
||||
|
||||
var msnry = new Masonry.Masonry('.grid', {
|
||||
columnWidth: 200,
|
||||
itemSelector: '.grid-item'
|
||||
});
|
||||
}
|
||||
|
||||
// extended Options
|
||||
function testExtendedOptions() {
|
||||
var msnry = new Masonry.Masonry('.grid', {
|
||||
itemSelector: '.grid-item',
|
||||
columnWidth: '.grid-sizer',
|
||||
percentPosition: true,
|
||||
gutter: '.gutter-sizer',
|
||||
stamp: '.stamp',
|
||||
fitWidth: true,
|
||||
originLeft: true,
|
||||
originTop: true,
|
||||
containerStyle: {
|
||||
position: 'relative'
|
||||
},
|
||||
transitionDuration: '0.4s',
|
||||
resize: true,
|
||||
initLayout: true
|
||||
});
|
||||
}
|
||||
|
||||
Vendored
+70
-70
@@ -1,70 +1,70 @@
|
||||
// Type definitions for Masonry 4.0.0
|
||||
// Project: https://github.com/desandro/masonry
|
||||
// Definitions by: Mark Wilson <https://github.com/m-a-wilson>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../jquery/jquery.d.ts" />
|
||||
|
||||
// Modified from original definitions by:
|
||||
// Travis Brown < https://github.com/warriorrocker>
|
||||
|
||||
declare module Masonry {
|
||||
|
||||
class Masonry implements MasonryGrid {
|
||||
constructor(options?: MasonryOptions);
|
||||
constructor(selector: string, options?: MasonryOptions);
|
||||
}
|
||||
|
||||
interface MasonryGrid {
|
||||
masonry?(): void;
|
||||
masonry?(eventName: string, listener: any): void;
|
||||
|
||||
// layout
|
||||
layout?(): void;
|
||||
layoutItems?(items: Array<any>, isStill?: boolean): void;
|
||||
stamp?(elements: Array<any>): void;
|
||||
unstamp?(elements: Array<any>): void;
|
||||
|
||||
// add and remove items
|
||||
appended?(elements: Array<any>): void;
|
||||
prepended?(elements: Array<any>): void;
|
||||
addItems?(elements: Array<any>): void;
|
||||
remove?(elements: Array<any>): void;
|
||||
|
||||
// events
|
||||
on?(eventName: string, listener: any): void;
|
||||
off?(eventName: string, listener: any): void;
|
||||
once?(eventName: string, listener: any): void;
|
||||
|
||||
// utilities
|
||||
reloadItems?(): void;
|
||||
destroy?(): void;
|
||||
getItemElements?(): Array<any>;
|
||||
data?(element: Element): Masonry;
|
||||
}
|
||||
|
||||
interface MasonryOptions {
|
||||
|
||||
// layout
|
||||
itemSelector?: string;
|
||||
columnWidth?: any;
|
||||
percentPosition?: boolean;
|
||||
gutter?: any;
|
||||
stamp?: string;
|
||||
fitWidth?: boolean;
|
||||
originLeft?: boolean;
|
||||
originTop?: boolean;
|
||||
|
||||
// setup
|
||||
containerStyle?: Object;
|
||||
transitionDuration?: any;
|
||||
resize?: boolean;
|
||||
initLayout?: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
interface JQuery {
|
||||
masonry(options?: Masonry.MasonryOptions): JQuery;
|
||||
}
|
||||
|
||||
|
||||
// Type definitions for Masonry 4.0.0
|
||||
// Project: https://github.com/desandro/masonry
|
||||
// Definitions by: Mark Wilson <https://github.com/m-a-wilson>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../jquery/jquery.d.ts" />
|
||||
|
||||
// Modified from original definitions by:
|
||||
// Travis Brown < https://github.com/warriorrocker>
|
||||
|
||||
declare module Masonry {
|
||||
|
||||
class Masonry implements MasonryGrid {
|
||||
constructor(options?: MasonryOptions);
|
||||
constructor(selector: string, options?: MasonryOptions);
|
||||
}
|
||||
|
||||
interface MasonryGrid {
|
||||
masonry?(): void;
|
||||
masonry?(eventName: string, listener: any): void;
|
||||
|
||||
// layout
|
||||
layout?(): void;
|
||||
layoutItems?(items: Array<any>, isStill?: boolean): void;
|
||||
stamp?(elements: Array<any>): void;
|
||||
unstamp?(elements: Array<any>): void;
|
||||
|
||||
// add and remove items
|
||||
appended?(elements: Array<any>): void;
|
||||
prepended?(elements: Array<any>): void;
|
||||
addItems?(elements: Array<any>): void;
|
||||
remove?(elements: Array<any>): void;
|
||||
|
||||
// events
|
||||
on?(eventName: string, listener: any): void;
|
||||
off?(eventName: string, listener: any): void;
|
||||
once?(eventName: string, listener: any): void;
|
||||
|
||||
// utilities
|
||||
reloadItems?(): void;
|
||||
destroy?(): void;
|
||||
getItemElements?(): Array<any>;
|
||||
data?(element: Element): Masonry;
|
||||
}
|
||||
|
||||
interface MasonryOptions {
|
||||
|
||||
// layout
|
||||
itemSelector?: string;
|
||||
columnWidth?: any;
|
||||
percentPosition?: boolean;
|
||||
gutter?: any;
|
||||
stamp?: string;
|
||||
fitWidth?: boolean;
|
||||
originLeft?: boolean;
|
||||
originTop?: boolean;
|
||||
|
||||
// setup
|
||||
containerStyle?: Object;
|
||||
transitionDuration?: any;
|
||||
resize?: boolean;
|
||||
initLayout?: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
interface JQuery {
|
||||
masonry(options?: Masonry.MasonryOptions): JQuery;
|
||||
}
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -49,7 +49,7 @@ interface IUser extends Document {
|
||||
data: any[];
|
||||
}
|
||||
|
||||
var UserModel: Model<IUser> = mongoose.model<IUser>('User', UserSchema);
|
||||
var UserModel: Model<IUser> = model<IUser>('User', UserSchema);
|
||||
|
||||
var user = new UserModel({name: 'Jane'});
|
||||
user.username; // IUser properties are available
|
||||
|
||||
Vendored
+3
-3
@@ -19,8 +19,8 @@ declare module "musicmetadata" {
|
||||
|
||||
declare namespace MM {
|
||||
export interface Options {
|
||||
duration: boolean;
|
||||
fileSize: number;
|
||||
duration?: boolean;
|
||||
fileSize?: number;
|
||||
}
|
||||
|
||||
export interface Metadata {
|
||||
@@ -45,4 +45,4 @@ declare namespace MM {
|
||||
format: string;
|
||||
data: Buffer;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,9 @@ opts = {};
|
||||
opts = {
|
||||
filter: /abc/
|
||||
};
|
||||
opts = {
|
||||
filter: (filename: string) => true
|
||||
};
|
||||
opts = {
|
||||
transform: (read: NodeJS.ReadableStream, write: NodeJS.WritableStream) => {
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -10,7 +10,7 @@ declare module 'ncp' {
|
||||
function ncp (source: string, destination: string, options: Options, callback: (err: Error) => void): void;
|
||||
|
||||
interface Options {
|
||||
filter? : RegExp;
|
||||
filter? : RegExp | ((filename: string) => boolean);
|
||||
transform? : (read: NodeJS.ReadableStream, write: NodeJS.WritableStream) => void;
|
||||
clobber? : boolean;
|
||||
stopOnErr? : boolean;
|
||||
|
||||
@@ -97,6 +97,12 @@ inst = inst.log(() => {
|
||||
|
||||
});
|
||||
|
||||
inst = inst.delay(2000);
|
||||
inst = inst.delayBody(2000);
|
||||
inst = inst.delayConnection(2000);
|
||||
inst.getTotalDelay();
|
||||
inst = inst.socketDelay(2000);
|
||||
|
||||
inst.done();
|
||||
bool = inst.isDone();
|
||||
inst.restore();
|
||||
|
||||
Vendored
+3
@@ -96,7 +96,10 @@ declare module "nock" {
|
||||
log(out: () => void): Scope;
|
||||
|
||||
delay(timeMs: number): Scope;
|
||||
delayBody(timeMs: number): Scope;
|
||||
delayConnection(timeMs: number): Scope;
|
||||
getTotalDelay(): number;
|
||||
socketDelay(timeMs: number): Scope;
|
||||
|
||||
times(repeats: number): Scope;
|
||||
once(): Scope;
|
||||
|
||||
Vendored
+1
@@ -688,6 +688,7 @@ declare module "child_process" {
|
||||
pid: number;
|
||||
kill(signal?: string): void;
|
||||
send(message: any, sendHandle: any): void;
|
||||
connected: boolean;
|
||||
disconnect(): void;
|
||||
}
|
||||
|
||||
|
||||
Vendored
+1
@@ -611,6 +611,7 @@ declare module "child_process" {
|
||||
pid: number;
|
||||
kill(signal?: string): void;
|
||||
send(message: any, sendHandle: any): void;
|
||||
connected: boolean;
|
||||
disconnect(): void;
|
||||
}
|
||||
|
||||
|
||||
Vendored
+1
@@ -829,6 +829,7 @@ declare module "child_process" {
|
||||
pid: number;
|
||||
kill(signal?: string): void;
|
||||
send(message: any, sendHandle?: any): void;
|
||||
connected: boolean;
|
||||
disconnect(): void;
|
||||
unref(): void;
|
||||
}
|
||||
|
||||
Vendored
+1
@@ -545,6 +545,7 @@ declare module "child_process" {
|
||||
pid: number;
|
||||
kill(signal?: string): void;
|
||||
send(message: any, sendHandle: any): void;
|
||||
connected: boolean;
|
||||
disconnect(): void;
|
||||
}
|
||||
|
||||
|
||||
+13
-1
@@ -839,4 +839,16 @@ namespace errors_tests {
|
||||
const myObject = {};
|
||||
Error.captureStackTrace(myObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
/// Console Tests : https://nodejs.org/api/console.html ///
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
import * as c from "console";
|
||||
namespace console_tests{
|
||||
{
|
||||
assert(c === console);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Vendored
+5
@@ -1036,6 +1036,7 @@ declare module "child_process" {
|
||||
pid: number;
|
||||
kill(signal?: string): void;
|
||||
send(message: any, sendHandle?: any): void;
|
||||
connected: boolean;
|
||||
disconnect(): void;
|
||||
unref(): void;
|
||||
}
|
||||
@@ -2407,3 +2408,7 @@ declare module "constants" {
|
||||
declare module "process" {
|
||||
export = process;
|
||||
}
|
||||
|
||||
declare module "console" {
|
||||
export = console;
|
||||
}
|
||||
|
||||
+61
-2
@@ -21,6 +21,7 @@ import * as os from "os";
|
||||
import * as vm from "vm";
|
||||
import * as string_decoder from "string_decoder";
|
||||
import * as stream from "stream";
|
||||
import * as timers from "timers";
|
||||
|
||||
// Specifically test buffer module regression.
|
||||
import {Buffer as ImportedBuffer, SlowBuffer as ImportedSlowBuffer} from "buffer";
|
||||
@@ -134,7 +135,7 @@ class Networker extends events.EventEmitter {
|
||||
}
|
||||
}
|
||||
|
||||
var errno: number;
|
||||
var errno: string;
|
||||
fs.readFile('testfile', (err, data) => {
|
||||
if (err && err.errno) {
|
||||
errno = err.errno;
|
||||
@@ -165,6 +166,22 @@ fs.watch('/tmp/foo-', {
|
||||
console.log(event, filename);
|
||||
});
|
||||
|
||||
fs.access('/path/to/folder', (err) => {});
|
||||
|
||||
fs.access(Buffer.from(''), (err) => {});
|
||||
|
||||
fs.access('/path/to/folder', fs.constants.F_OK | fs.constants.R_OK, (err) => {});
|
||||
|
||||
fs.access(Buffer.from(''), fs.constants.F_OK | fs.constants.R_OK, (err) => {});
|
||||
|
||||
fs.accessSync('/path/to/folder');
|
||||
|
||||
fs.accessSync(Buffer.from(''));
|
||||
|
||||
fs.accessSync('path/to/folder', fs.constants.W_OK | fs.constants.X_OK);
|
||||
|
||||
fs.accessSync(Buffer.from(''), fs.constants.W_OK | fs.constants.X_OK);
|
||||
|
||||
///////////////////////////////////////////////////////
|
||||
/// Buffer tests : https://nodejs.org/api/buffer.html
|
||||
///////////////////////////////////////////////////////
|
||||
@@ -263,9 +280,11 @@ function bufferTests() {
|
||||
let buffer = new Buffer('123');
|
||||
let val: [number, number];
|
||||
|
||||
/* comment out for --target es5
|
||||
for (let entry of buffer.entries()) {
|
||||
val = entry;
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
{
|
||||
@@ -286,18 +305,22 @@ function bufferTests() {
|
||||
let buffer = new Buffer('123');
|
||||
let val: number;
|
||||
|
||||
/* comment out for --target es5
|
||||
for (let key of buffer.keys()) {
|
||||
val = key;
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
{
|
||||
let buffer = new Buffer('123');
|
||||
let val: number;
|
||||
|
||||
/* comment out for --target es5
|
||||
for (let value of buffer.values()) {
|
||||
val = value;
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
// Imported Buffer from buffer module works properly
|
||||
@@ -982,6 +1005,31 @@ namespace vm_tests {
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/// Timers tests : https://nodejs.org/api/timers.html
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
namespace timers_tests {
|
||||
{
|
||||
let immediateId = timers.setImmediate(function(){ console.log("immediate"); });
|
||||
timers.clearImmediate(immediateId);
|
||||
}
|
||||
{
|
||||
let counter = 0;
|
||||
let timeout = timers.setInterval(function(){ console.log("interval"); }, 20);
|
||||
timeout.unref();
|
||||
timeout.ref();
|
||||
timers.clearInterval(timeout);
|
||||
}
|
||||
{
|
||||
let counter = 0;
|
||||
let timeout = timers.setTimeout(function(){ console.log("timeout"); }, 20);
|
||||
timeout.unref();
|
||||
timeout.ref();
|
||||
timers.clearTimeout(timeout);
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////
|
||||
/// Errors Tests : https://nodejs.org/api/errors.html ///
|
||||
/////////////////////////////////////////////////////////
|
||||
@@ -1001,4 +1049,15 @@ namespace process_tests{
|
||||
var eventEmitter: events.EventEmitter;
|
||||
eventEmitter = process; // Test that process implements EventEmitter...
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
/// Console Tests : https://nodejs.org/api/console.html ///
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
import * as c from "console";
|
||||
namespace console_tests{
|
||||
{
|
||||
assert(c === console);
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+152
-18
@@ -233,7 +233,7 @@ declare var Buffer: {
|
||||
************************************************/
|
||||
declare namespace NodeJS {
|
||||
export interface ErrnoException extends Error {
|
||||
errno?: number;
|
||||
errno?: string;
|
||||
code?: string;
|
||||
path?: string;
|
||||
syscall?: string;
|
||||
@@ -372,7 +372,7 @@ declare namespace NodeJS {
|
||||
arch: string;
|
||||
platform: string;
|
||||
memoryUsage(): MemoryUsage;
|
||||
nextTick(callback: Function): void;
|
||||
nextTick(callback: Function, ...args: any[]): void;
|
||||
umask(mask?: number): number;
|
||||
uptime(): number;
|
||||
hrtime(time?: number[]): number[];
|
||||
@@ -456,6 +456,8 @@ declare namespace NodeJS {
|
||||
}
|
||||
}
|
||||
|
||||
interface IterableIterator<T> {}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
@@ -464,7 +466,7 @@ interface NodeBuffer extends Uint8Array {
|
||||
toString(encoding?: string, start?: number, end?: number): string;
|
||||
toJSON(): any;
|
||||
equals(otherBuffer: Buffer): boolean;
|
||||
compare(otherBuffer: Buffer): number;
|
||||
compare(otherBuffer: Buffer, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): number;
|
||||
copy(targetBuffer: Buffer, targetStart?: number, sourceStart?: number, sourceEnd?: number): number;
|
||||
slice(start?: number, end?: number): Buffer;
|
||||
writeUIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
|
||||
@@ -655,6 +657,9 @@ declare module "http" {
|
||||
}
|
||||
export interface IncomingMessage extends events.EventEmitter, stream.Readable {
|
||||
httpVersion: string;
|
||||
httpVersionMajor: string;
|
||||
httpVersionMinor: string;
|
||||
connection: any;
|
||||
headers: any;
|
||||
rawHeaders: string[];
|
||||
trailers: any;
|
||||
@@ -894,6 +899,7 @@ declare module "os" {
|
||||
export function freemem(): number;
|
||||
export function cpus(): CpuInfo[];
|
||||
export function networkInterfaces(): { [index: string]: NetworkInterfaceInfo[] };
|
||||
export function userInfo(options?: {encoding: string}): { username: string, uid: number, gid: number, shell: any, homedir: string }
|
||||
export var EOL: string;
|
||||
}
|
||||
|
||||
@@ -967,7 +973,7 @@ declare module "punycode" {
|
||||
|
||||
declare module "repl" {
|
||||
import * as stream from "stream";
|
||||
import * as events from "events";
|
||||
import * as readline from "readline";
|
||||
|
||||
export interface ReplOptions {
|
||||
prompt?: string;
|
||||
@@ -979,8 +985,17 @@ declare module "repl" {
|
||||
useGlobal?: boolean;
|
||||
ignoreUndefined?: boolean;
|
||||
writer?: Function;
|
||||
completer?: Function;
|
||||
replMode?: any;
|
||||
breakEvalOnSigint?: any;
|
||||
}
|
||||
export function start(options: ReplOptions): events.EventEmitter;
|
||||
|
||||
export interface REPLServer extends readline.ReadLine {
|
||||
defineCommand(keyword: string, cmd: Function | { help: string, action: Function }): void;
|
||||
displayPrompt(preserveCursor?: boolean): void
|
||||
}
|
||||
|
||||
export function start(options: ReplOptions): REPLServer;
|
||||
}
|
||||
|
||||
declare module "readline" {
|
||||
@@ -1273,6 +1288,32 @@ declare module "dns" {
|
||||
export function resolveNs(domain: string, callback: (err: Error, addresses: string[]) => void): string[];
|
||||
export function resolveCname(domain: string, callback: (err: Error, addresses: string[]) => void): string[];
|
||||
export function reverse(ip: string, callback: (err: Error, domains: string[]) => void): string[];
|
||||
|
||||
//Error codes
|
||||
export var NODATA: string;
|
||||
export var FORMERR: string;
|
||||
export var SERVFAIL: string;
|
||||
export var NOTFOUND: string;
|
||||
export var NOTIMP: string;
|
||||
export var REFUSED: string;
|
||||
export var BADQUERY: string;
|
||||
export var BADNAME: string;
|
||||
export var BADFAMILY: string;
|
||||
export var BADRESP: string;
|
||||
export var CONNREFUSED: string;
|
||||
export var TIMEOUT: string;
|
||||
export var EOF: string;
|
||||
export var FILE: string;
|
||||
export var NOMEM: string;
|
||||
export var DESTRUCTION: string;
|
||||
export var BADSTR: string;
|
||||
export var BADFLAGS: string;
|
||||
export var NONAME: string;
|
||||
export var BADHINTS: string;
|
||||
export var NOTINITIALIZED: string;
|
||||
export var LOADIPHLPAPI: string;
|
||||
export var ADDRGETNETWORKPARAMS: string;
|
||||
export var CANCELLED: string;
|
||||
}
|
||||
|
||||
declare module "net" {
|
||||
@@ -1375,19 +1416,35 @@ declare module "dgram" {
|
||||
port: number;
|
||||
}
|
||||
|
||||
interface BindOptions {
|
||||
port: number;
|
||||
address?: string;
|
||||
exclusive?: boolean;
|
||||
}
|
||||
|
||||
interface SocketOptions {
|
||||
type: string;
|
||||
reuseAddr?: boolean;
|
||||
}
|
||||
|
||||
export function createSocket(type: string, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket;
|
||||
export function createSocket(options: SocketOptions, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket;
|
||||
|
||||
interface Socket extends events.EventEmitter {
|
||||
send(buf: Buffer, port: number, address: string, callback?: (error: Error, bytes: number) => void): void;
|
||||
send(buf: Buffer, offset: number, length: number, port: number, address: string, callback?: (error: Error, bytes: number) => void): void;
|
||||
send(msg: Buffer | String | any[], port: number, address: string, callback?: (error: Error, bytes: number) => void): void;
|
||||
send(msg: Buffer | String | any[], offset: number, length: number, port: number, address: string, callback?: (error: Error, bytes: number) => void): void;
|
||||
bind(port?: number, address?: string, callback?: () => void): void;
|
||||
close(): void;
|
||||
bind(options: BindOptions, callback?: Function): void;
|
||||
close(callback?: any): void;
|
||||
address(): AddressInfo;
|
||||
setBroadcast(flag: boolean): void;
|
||||
setTTL(ttl: number): void;
|
||||
setMulticastTTL(ttl: number): void;
|
||||
setMulticastLoopback(flag: boolean): void;
|
||||
addMembership(multicastAddress: string, multicastInterface?: string): void;
|
||||
dropMembership(multicastAddress: string, multicastInterface?: string): void;
|
||||
ref(): void;
|
||||
unref(): void;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1660,14 +1717,23 @@ declare module "fs" {
|
||||
export function watch(filename: string, options: { persistent?: boolean; recursive?: boolean; encoding?: string }, listener?: (event: string, filename: string | Buffer) => any): FSWatcher;
|
||||
export function exists(path: string | Buffer, callback?: (exists: boolean) => void): void;
|
||||
export function existsSync(path: string | Buffer): boolean;
|
||||
/** Constant for fs.access(). File is visible to the calling process. */
|
||||
export var F_OK: number;
|
||||
/** Constant for fs.access(). File can be read by the calling process. */
|
||||
export var R_OK: number;
|
||||
/** Constant for fs.access(). File can be written by the calling process. */
|
||||
export var W_OK: number;
|
||||
/** Constant for fs.access(). File can be executed by the calling process. */
|
||||
export var X_OK: number;
|
||||
|
||||
interface Constants {
|
||||
/** Constant for fs.access(). File is visible to the calling process. */
|
||||
F_OK: number;
|
||||
|
||||
/** Constant for fs.access(). File can be read by the calling process. */
|
||||
R_OK: number;
|
||||
|
||||
/** Constant for fs.access(). File can be written by the calling process. */
|
||||
W_OK: number;
|
||||
|
||||
/** Constant for fs.access(). File can be executed by the calling process. */
|
||||
X_OK: number;
|
||||
}
|
||||
|
||||
export const constants: Constants;
|
||||
|
||||
/** Tests a user's permissions for the file specified by path. */
|
||||
export function access(path: string | Buffer, callback: (err: NodeJS.ErrnoException) => void): void;
|
||||
export function access(path: string | Buffer, mode: number, callback: (err: NodeJS.ErrnoException) => void): void;
|
||||
@@ -1688,6 +1754,8 @@ declare module "fs" {
|
||||
fd?: number;
|
||||
mode?: number;
|
||||
}): WriteStream;
|
||||
export function fdatasync(fd: number, callback: Function): void;
|
||||
export function fdatasyncSync(fd: number): void;
|
||||
}
|
||||
|
||||
declare module "path" {
|
||||
@@ -2136,12 +2204,14 @@ declare module "crypto" {
|
||||
export function createSign(algorithm: string): Signer;
|
||||
export interface Signer extends NodeJS.WritableStream {
|
||||
update(data: any): void;
|
||||
sign(private_key: string, output_format: string): string;
|
||||
sign(private_key: string): Buffer;
|
||||
sign(private_key: string, output_format: 'latin1' | 'hex' | 'base64'): string;
|
||||
}
|
||||
export function createVerify(algorith: string): Verify;
|
||||
export interface Verify extends NodeJS.WritableStream {
|
||||
update(data: any): void;
|
||||
verify(object: string, signature: string, signature_format?: string): boolean;
|
||||
verify(object: string, signature: Buffer): boolean;
|
||||
verify(object: string, signature: string, signature_format: 'latin1' | 'hex' | 'base64'): boolean;
|
||||
}
|
||||
export function createDiffieHellman(prime_length: number): DiffieHellman;
|
||||
export function createDiffieHellman(prime: number, encoding?: string): DiffieHellman;
|
||||
@@ -2178,6 +2248,15 @@ declare module "crypto" {
|
||||
export function getCiphers(): string[];
|
||||
export function getCurves(): string[];
|
||||
export function getHashes(): string[];
|
||||
export interface ECDH {
|
||||
computeSecret(other_public_key: string, input_encoding?: string, output_encoding?: string): string | Buffer;
|
||||
generateKeys(encoding?: string, format?: string): string | Buffer;
|
||||
getPrivateKey(encoding?: string): string | Buffer;
|
||||
getPublicKey(encodind?: string): string | Buffer;
|
||||
setPrivateKey(private_key: string | Buffer, encoding?: string): void;
|
||||
setPublicKey(publick_key: string | Buffer, encoding?: string): void;
|
||||
}
|
||||
export function createECDH(curve_name: string): ECDH;
|
||||
}
|
||||
|
||||
declare module "stream" {
|
||||
@@ -2303,6 +2382,18 @@ declare module "util" {
|
||||
export function isError(object: any): boolean;
|
||||
export function inherits(constructor: any, superConstructor: any): void;
|
||||
export function debuglog(key: string): (msg: string, ...param: any[]) => void;
|
||||
export function isBoolean(object: any): boolean;
|
||||
export function isBuffer(object: any): boolean;
|
||||
export function isFunction(object: any): boolean;
|
||||
export function isNull(object: any): boolean;
|
||||
export function isNullOrUndefined(object: any): boolean;
|
||||
export function isNumber(object: any): boolean;
|
||||
export function isObject(object: any): boolean;
|
||||
export function isPrimitive(object: any): boolean;
|
||||
export function isString(object: any): boolean;
|
||||
export function isSymbol(object: any): boolean;
|
||||
export function isUndefined(object: any): boolean;
|
||||
export function deprecate(fn: Function, message: string): Function;
|
||||
}
|
||||
|
||||
declare module "assert" {
|
||||
@@ -2378,6 +2469,9 @@ declare module "domain" {
|
||||
bind(cb: (err: Error, data: any) => any): any;
|
||||
intercept(cb: (data: any) => any): any;
|
||||
dispose(): void;
|
||||
members: any[];
|
||||
enter(): void;
|
||||
exit(): void;
|
||||
}
|
||||
|
||||
export function create(): Domain;
|
||||
@@ -2628,8 +2722,48 @@ declare module "constants" {
|
||||
export var W_OK: number;
|
||||
export var X_OK: number;
|
||||
export var UV_UDP_REUSEADDR: number;
|
||||
export var SIGQUIT: number;
|
||||
export var SIGTRAP: number;
|
||||
export var SIGIOT: number;
|
||||
export var SIGBUS: number;
|
||||
export var SIGUSR1: number;
|
||||
export var SIGUSR2: number;
|
||||
export var SIGPIPE: number;
|
||||
export var SIGALRM: number;
|
||||
export var SIGCHLD: number;
|
||||
export var SIGSTKFLT: number;
|
||||
export var SIGCONT: number;
|
||||
export var SIGSTOP: number;
|
||||
export var SIGTSTP: number;
|
||||
export var SIGTTIN: number;
|
||||
export var SIGTTOU: number;
|
||||
export var SIGURG: number;
|
||||
export var SIGXCPU: number;
|
||||
export var SIGXFSZ: number;
|
||||
export var SIGVTALRM: number;
|
||||
export var SIGPROF: number;
|
||||
export var SIGIO: number;
|
||||
export var SIGPOLL: number;
|
||||
export var SIGPWR: number;
|
||||
export var SIGSYS: number;
|
||||
export var SIGUNUSED: number;
|
||||
export var defaultCoreCipherList: string;
|
||||
export var defaultCipherList: string;
|
||||
}
|
||||
|
||||
declare module "process" {
|
||||
export = process;
|
||||
}
|
||||
|
||||
declare module "timers" {
|
||||
export function setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timer;
|
||||
export function clearTimeout(timeoutId: NodeJS.Timer): void;
|
||||
export function setInterval(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timer;
|
||||
export function clearInterval(intervalId: NodeJS.Timer): void;
|
||||
export function setImmediate(callback: (...args: any[]) => void, ...args: any[]): any;
|
||||
export function clearImmediate(immediateId: any): void;
|
||||
}
|
||||
|
||||
declare module "console" {
|
||||
export = console;
|
||||
}
|
||||
Vendored
+131
-131
@@ -1,131 +1,131 @@
|
||||
// Type definitions for notify.js
|
||||
// Project: https://github.com/notifyjs/notifyjs
|
||||
// Definitions by: Bahman Nikkhahan <https://github.com/bahman616>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference path="../jquery/jquery.d.ts" />
|
||||
|
||||
declare namespace NotifyJS {
|
||||
interface NotificationOptions {
|
||||
// whether to hide the notification on click
|
||||
clickToHide: boolean;
|
||||
// whether to auto-hide the notification
|
||||
autoHide: boolean;
|
||||
// if autoHide, hide after milliseconds
|
||||
autoHideDelay: number;
|
||||
// show the arrow pointing at the element
|
||||
arrowShow: boolean;
|
||||
// arrow size in pixels
|
||||
arrowSize: number;
|
||||
// position defines the notification position though uses the defaults below
|
||||
position: string;
|
||||
// default positions
|
||||
elementPosition: string;
|
||||
globalPosition: string;
|
||||
// default style
|
||||
style: string;
|
||||
// default class (string or [string])
|
||||
className: string;
|
||||
// show animation
|
||||
showAnimation: string;
|
||||
// show animation duration
|
||||
showDuration: number;
|
||||
// hide animation
|
||||
hideAnimation: string;
|
||||
// hide animation duration
|
||||
hideDuration: number;
|
||||
// padding between element and notification
|
||||
gap: number;
|
||||
}
|
||||
|
||||
interface JQueryStaticNotify {
|
||||
/**
|
||||
* notify user
|
||||
* @param element a jquery element
|
||||
* @param notificationdata global notification data
|
||||
* @param options notification options
|
||||
*/
|
||||
(element?: any, notificationdata?: any, options?: NotificationOptions): JQueryStatic;
|
||||
|
||||
/**
|
||||
* Add style
|
||||
* @param styleName style name
|
||||
* @param styleDefinition style definition object
|
||||
*/
|
||||
addStyle(styleName: string, styleDefinition: any): any;
|
||||
|
||||
/**
|
||||
* Remove style
|
||||
* @param styleName style name
|
||||
*/
|
||||
removeStyle(styleName: string): any;
|
||||
|
||||
/**
|
||||
* Get style
|
||||
* @param styleName style name
|
||||
*/
|
||||
getStyle(styleName: string): any;
|
||||
|
||||
/**
|
||||
* Insert css
|
||||
* @param cssText css text to insert
|
||||
*/
|
||||
insertCSS(cssText: string): any;
|
||||
|
||||
/**
|
||||
* Set defaults for notifications
|
||||
* @param options notification iptions
|
||||
*/
|
||||
defaults(options: NotificationOptions): any;
|
||||
}
|
||||
|
||||
interface JQueryStatic {
|
||||
notify: JQueryStaticNotify;
|
||||
}
|
||||
|
||||
interface JQueryNotify {
|
||||
/**
|
||||
* notify user
|
||||
* @param element a jquery element
|
||||
* @param notificationdata global notification data
|
||||
* @param options notification options
|
||||
*/
|
||||
(element?: any, notificationdata?: any, options?: NotificationOptions): JQuery;
|
||||
|
||||
/**
|
||||
* Add style
|
||||
* @param styleName style name
|
||||
* @param styleDefinition style definition object
|
||||
*/
|
||||
addStyle(styleName: string, styleDefinition: any): any;
|
||||
|
||||
/**
|
||||
* Remove style
|
||||
* @param styleName style name
|
||||
*/
|
||||
removeStyle(styleName: string): any;
|
||||
|
||||
/**
|
||||
* Get style
|
||||
* @param styleName style name
|
||||
*/
|
||||
getStyle(styleName: string): any;
|
||||
|
||||
/**
|
||||
* Insert css
|
||||
* @param cssText css text to insert
|
||||
*/
|
||||
insertCSS(cssText: string): any;
|
||||
|
||||
/**
|
||||
* Set defaults for notifications
|
||||
* @param options notification iptions
|
||||
*/
|
||||
defaults(options: NotificationOptions): any;
|
||||
|
||||
}
|
||||
|
||||
interface JQuery {
|
||||
notify: JQueryStaticNotify;
|
||||
}
|
||||
}
|
||||
// Type definitions for notify.js
|
||||
// Project: https://github.com/notifyjs/notifyjs
|
||||
// Definitions by: Bahman Nikkhahan <https://github.com/bahman616>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference path="../jquery/jquery.d.ts" />
|
||||
|
||||
declare namespace NotifyJS {
|
||||
interface NotificationOptions {
|
||||
// whether to hide the notification on click
|
||||
clickToHide: boolean;
|
||||
// whether to auto-hide the notification
|
||||
autoHide: boolean;
|
||||
// if autoHide, hide after milliseconds
|
||||
autoHideDelay: number;
|
||||
// show the arrow pointing at the element
|
||||
arrowShow: boolean;
|
||||
// arrow size in pixels
|
||||
arrowSize: number;
|
||||
// position defines the notification position though uses the defaults below
|
||||
position: string;
|
||||
// default positions
|
||||
elementPosition: string;
|
||||
globalPosition: string;
|
||||
// default style
|
||||
style: string;
|
||||
// default class (string or [string])
|
||||
className: string;
|
||||
// show animation
|
||||
showAnimation: string;
|
||||
// show animation duration
|
||||
showDuration: number;
|
||||
// hide animation
|
||||
hideAnimation: string;
|
||||
// hide animation duration
|
||||
hideDuration: number;
|
||||
// padding between element and notification
|
||||
gap: number;
|
||||
}
|
||||
|
||||
interface JQueryStaticNotify {
|
||||
/**
|
||||
* notify user
|
||||
* @param element a jquery element
|
||||
* @param notificationdata global notification data
|
||||
* @param options notification options
|
||||
*/
|
||||
(element?: any, notificationdata?: any, options?: NotificationOptions): JQueryStatic;
|
||||
|
||||
/**
|
||||
* Add style
|
||||
* @param styleName style name
|
||||
* @param styleDefinition style definition object
|
||||
*/
|
||||
addStyle(styleName: string, styleDefinition: any): any;
|
||||
|
||||
/**
|
||||
* Remove style
|
||||
* @param styleName style name
|
||||
*/
|
||||
removeStyle(styleName: string): any;
|
||||
|
||||
/**
|
||||
* Get style
|
||||
* @param styleName style name
|
||||
*/
|
||||
getStyle(styleName: string): any;
|
||||
|
||||
/**
|
||||
* Insert css
|
||||
* @param cssText css text to insert
|
||||
*/
|
||||
insertCSS(cssText: string): any;
|
||||
|
||||
/**
|
||||
* Set defaults for notifications
|
||||
* @param options notification iptions
|
||||
*/
|
||||
defaults(options: NotificationOptions): any;
|
||||
}
|
||||
|
||||
interface JQueryStatic {
|
||||
notify: JQueryStaticNotify;
|
||||
}
|
||||
|
||||
interface JQueryNotify {
|
||||
/**
|
||||
* notify user
|
||||
* @param element a jquery element
|
||||
* @param notificationdata global notification data
|
||||
* @param options notification options
|
||||
*/
|
||||
(element?: any, notificationdata?: any, options?: NotificationOptions): JQuery;
|
||||
|
||||
/**
|
||||
* Add style
|
||||
* @param styleName style name
|
||||
* @param styleDefinition style definition object
|
||||
*/
|
||||
addStyle(styleName: string, styleDefinition: any): any;
|
||||
|
||||
/**
|
||||
* Remove style
|
||||
* @param styleName style name
|
||||
*/
|
||||
removeStyle(styleName: string): any;
|
||||
|
||||
/**
|
||||
* Get style
|
||||
* @param styleName style name
|
||||
*/
|
||||
getStyle(styleName: string): any;
|
||||
|
||||
/**
|
||||
* Insert css
|
||||
* @param cssText css text to insert
|
||||
*/
|
||||
insertCSS(cssText: string): any;
|
||||
|
||||
/**
|
||||
* Set defaults for notifications
|
||||
* @param options notification iptions
|
||||
*/
|
||||
defaults(options: NotificationOptions): any;
|
||||
|
||||
}
|
||||
|
||||
interface JQuery {
|
||||
notify: JQueryStaticNotify;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,53 +1,53 @@
|
||||
/// <reference path="../jquery/jquery.d.ts"/>
|
||||
/// <reference path="notify.js.d.ts"/>
|
||||
|
||||
// setting defaults for notification plugin
|
||||
$.notify.defaults({
|
||||
clickToHide: true,
|
||||
autoHide: false,
|
||||
autoHideDelay: 5000,
|
||||
arrowShow: true,
|
||||
arrowSize: 5,
|
||||
position: 'top center',
|
||||
elementPosition: 'bottom left',
|
||||
globalPosition: 'top center',
|
||||
style: 'bootstrap',
|
||||
className: 'error',
|
||||
showAnimation: 'slideDown',
|
||||
showDuration: 400,
|
||||
hideAnimation: 'slideUp',
|
||||
hideDuration: 200,
|
||||
gap: 2
|
||||
});
|
||||
|
||||
$(".elem-demo").notify("Hello Box");
|
||||
$.notify("Access granted", "success");
|
||||
$.notify("Do not press this button", "info");
|
||||
$.notify('hello !!', {
|
||||
style: 'happyblue'
|
||||
});
|
||||
$.notify('hello !!', {
|
||||
style: 'happyblue'
|
||||
});
|
||||
//add a new style 'foo'
|
||||
$.notify.addStyle('foo', {
|
||||
html:
|
||||
"<div>" +
|
||||
"<div class='clearfix'>" +
|
||||
"<div class='title' data-notify-html='title'/>" +
|
||||
"<div class='buttons'>" +
|
||||
"<button class='no'>Cancel</button>" +
|
||||
"<button class='yes' data-notify-text='button'></button>" +
|
||||
"</div>" +
|
||||
"</div>" +
|
||||
"</div>"
|
||||
});
|
||||
|
||||
$.notify({
|
||||
title: 'Would you like some Foo ?',
|
||||
button: 'Confirm'
|
||||
}, {
|
||||
style: 'foo',
|
||||
autoHide: false,
|
||||
clickToHide: false
|
||||
/// <reference path="../jquery/jquery.d.ts"/>
|
||||
/// <reference path="notify.js.d.ts"/>
|
||||
|
||||
// setting defaults for notification plugin
|
||||
$.notify.defaults({
|
||||
clickToHide: true,
|
||||
autoHide: false,
|
||||
autoHideDelay: 5000,
|
||||
arrowShow: true,
|
||||
arrowSize: 5,
|
||||
position: 'top center',
|
||||
elementPosition: 'bottom left',
|
||||
globalPosition: 'top center',
|
||||
style: 'bootstrap',
|
||||
className: 'error',
|
||||
showAnimation: 'slideDown',
|
||||
showDuration: 400,
|
||||
hideAnimation: 'slideUp',
|
||||
hideDuration: 200,
|
||||
gap: 2
|
||||
});
|
||||
|
||||
$(".elem-demo").notify("Hello Box");
|
||||
$.notify("Access granted", "success");
|
||||
$.notify("Do not press this button", "info");
|
||||
$.notify('hello !!', {
|
||||
style: 'happyblue'
|
||||
});
|
||||
$.notify('hello !!', {
|
||||
style: 'happyblue'
|
||||
});
|
||||
//add a new style 'foo'
|
||||
$.notify.addStyle('foo', {
|
||||
html:
|
||||
"<div>" +
|
||||
"<div class='clearfix'>" +
|
||||
"<div class='title' data-notify-html='title'/>" +
|
||||
"<div class='buttons'>" +
|
||||
"<button class='no'>Cancel</button>" +
|
||||
"<button class='yes' data-notify-text='button'></button>" +
|
||||
"</div>" +
|
||||
"</div>" +
|
||||
"</div>"
|
||||
});
|
||||
|
||||
$.notify({
|
||||
title: 'Would you like some Foo ?',
|
||||
button: 'Confirm'
|
||||
}, {
|
||||
style: 'foo',
|
||||
autoHide: false,
|
||||
clickToHide: false
|
||||
});
|
||||
Vendored
+74
-27
@@ -1,4 +1,4 @@
|
||||
// Type definitions for OpenLayers v3.6.0
|
||||
// Type definitions for OpenLayers v3.18.2
|
||||
// Project: http://openlayers.org/
|
||||
// Definitions by: Wouter Goedhart <https://github.com/woutergd>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
@@ -48,6 +48,25 @@ declare namespace olx {
|
||||
extent: ol.Extent;
|
||||
}
|
||||
|
||||
interface RotateOptions {
|
||||
/*** CSS class name. Default is ol-rotate.*/
|
||||
className?: string;
|
||||
/*** Text label to use for the rotate button. Default is ⇧. Instead of text, also a Node (e.g. a span element) can be used.*/
|
||||
label?: string | Element;
|
||||
/*** Text label to use for the rotate tip. Default is Reset rotation.*/
|
||||
tipLabel?: string;
|
||||
/*** Animation duration in milliseconds. Default is 250.*/
|
||||
duration?: number;
|
||||
/*** Hide the control when rotation is 0. Default is true.*/
|
||||
autoHide?: boolean;
|
||||
/*** Function called when the control should be re-rendered. This is called in a requestAnimationFrame callback.*/
|
||||
render?: Function;
|
||||
/*** Function called when the control is clicked. This will override the default resetNorth.*/
|
||||
resetNorth?: Function;
|
||||
/*** Target.*/
|
||||
target?: Element;
|
||||
}
|
||||
|
||||
interface AttributionOptions {
|
||||
|
||||
/** HTML markup for this attribution. */
|
||||
@@ -211,6 +230,30 @@ declare namespace olx {
|
||||
/** experimental Whether to wrap the world horizontally. When set to false, only one world will be rendered. When true, tiles will be requested for one world only, but they will be wrapped horizontally to render multiple worlds. The default is true. */
|
||||
wrapX?: boolean;
|
||||
}
|
||||
interface OSMOptions {
|
||||
/** Attributions */
|
||||
attributions?: ol.AttributionLike;
|
||||
/** Cache size. Default is 2048. */
|
||||
cacheSize?: number;
|
||||
/**
|
||||
* 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. Default is anonymous.
|
||||
*/
|
||||
crossOrigin?: string;
|
||||
/** Max zoom. Default is 19. */
|
||||
maxZoom?: number;
|
||||
/** Whether the layer is opaque. Default is true. */
|
||||
opaque?: boolean;
|
||||
/** Maximum allowed reprojection error (in pixels). Default is 0.5. Higher values can increase reprojection performance, but decrease precision. */
|
||||
reprojectionErrorThreshold?: number;
|
||||
/** Optional function to load a tile given a URL. */
|
||||
tileLoadFunction?: ol.TileLoadFunctionType;
|
||||
/** URL template. Must include {x}, {y} or {-y}, and {z} placeholders. Default is https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png. */
|
||||
url?: string;
|
||||
/** Whether to wrap the world horizontally. Default is true. */
|
||||
wrapX?: boolean;
|
||||
}
|
||||
/**
|
||||
* Object literal with config options for the map logo.
|
||||
*/
|
||||
@@ -791,24 +834,24 @@ declare namespace olx {
|
||||
*/
|
||||
wrapX?: boolean;
|
||||
}
|
||||
|
||||
|
||||
interface ClusterOptions extends VectorOptions{
|
||||
|
||||
|
||||
/**
|
||||
* Minimum distance in pixels between clusters. Default is 20.
|
||||
*/
|
||||
distance?: number;
|
||||
|
||||
|
||||
extent?: ol.Extent;
|
||||
|
||||
|
||||
geometryFunction?: any;
|
||||
|
||||
|
||||
projection?: ol.proj.ProjectionLike;
|
||||
|
||||
|
||||
source: ol.source.Vector;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
interface WMTSOptions {
|
||||
attributions?: Array<ol.Attribution>;
|
||||
crossOrigin?: string;
|
||||
@@ -1127,6 +1170,8 @@ declare namespace ol {
|
||||
|
||||
interface ImageLoadFunctionType { (image: ol.Image, url: string): void }
|
||||
|
||||
type AttributionLike = string | Array<string> | ol.Attribution | Array<ol.Attribution>
|
||||
|
||||
/**
|
||||
* An attribution for a layer source.
|
||||
*/
|
||||
@@ -2422,9 +2467,9 @@ declare namespace ol {
|
||||
* @returns Control.s
|
||||
*/
|
||||
function defaults(options?: olx.control.DefaultsOptions): ol.Collection<ol.control.Control>;
|
||||
|
||||
|
||||
namespace ScaleLine {
|
||||
|
||||
|
||||
/**
|
||||
* Units for the scale line. Supported values are 'degrees', 'imperial', 'nautical', 'metric', 'us'.
|
||||
*/
|
||||
@@ -2433,29 +2478,29 @@ declare namespace ol {
|
||||
|
||||
class Control extends ol.Object{
|
||||
constructor(options: olx.control.ControlOptions);
|
||||
|
||||
|
||||
/**
|
||||
* Get the map associated with this control.
|
||||
*/
|
||||
getMap():ol.Map;
|
||||
|
||||
|
||||
/**
|
||||
* Remove the control from its current map and attach it to the new map.
|
||||
* Remove the control from its current map and attach it to the new map.
|
||||
* Subclasses may set up event handlers to get notified about changes to the map here.
|
||||
*/
|
||||
setMap(map: ol.Map):void;
|
||||
|
||||
|
||||
/**
|
||||
* This function is used to set a target element for the control.
|
||||
* It has no effect if it is called after the control has been added to the map (i.e. after setMap is called on the control).
|
||||
* If no target is set in the options passed to the control constructor and if setTarget is not called then the control is
|
||||
* This function is used to set a target element for the control.
|
||||
* It has no effect if it is called after the control has been added to the map (i.e. after setMap is called on the control).
|
||||
* If no target is set in the options passed to the control constructor and if setTarget is not called then the control is
|
||||
* added to the map's overlay container.
|
||||
*/
|
||||
setTarget(target: Element | string):void;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
class Attribution extends Control {
|
||||
}
|
||||
|
||||
@@ -2469,20 +2514,21 @@ declare namespace ol {
|
||||
}
|
||||
|
||||
class Rotate extends Control {
|
||||
constructor(opt_options?: olx.RotateOptions);
|
||||
}
|
||||
|
||||
class ScaleLine extends Control {
|
||||
|
||||
|
||||
/**
|
||||
* Return the units to use in the scale line.
|
||||
*/
|
||||
getUnits(): ScaleLine.Units;
|
||||
|
||||
|
||||
/**
|
||||
* Set the units to use in the scale line.
|
||||
*/
|
||||
setUnits(units: ScaleLine.Units): void;
|
||||
|
||||
|
||||
}
|
||||
|
||||
class Zoom extends Control{
|
||||
@@ -4061,7 +4107,7 @@ declare namespace ol {
|
||||
* @argument map.
|
||||
*/
|
||||
setMap(map: ol.Map): void;
|
||||
|
||||
|
||||
/**
|
||||
* Set Z-index of the layer, which is used to order layers before rendering. The default Z-index is 0.
|
||||
*/
|
||||
@@ -4254,12 +4300,13 @@ declare namespace ol {
|
||||
}
|
||||
|
||||
class OSM extends XYZ {
|
||||
constructor(opt_options?: olx.OSMOptions);
|
||||
}
|
||||
|
||||
class Source extends ol.Object {
|
||||
|
||||
|
||||
constructor(options: any);
|
||||
|
||||
|
||||
/**
|
||||
* Get the projection of the source.
|
||||
* @return Projection.
|
||||
|
||||
Vendored
+1
-1
@@ -1072,7 +1072,7 @@ declare namespace Parse {
|
||||
title?: string;
|
||||
}
|
||||
|
||||
interface SendOptions {
|
||||
interface SendOptions extends UseMasterKeyOption {
|
||||
success?: () => void;
|
||||
error?: (error: Error) => void;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
/// <reference path="../cordova/cordova.d.ts"/>
|
||||
/// <reference path="phonegap-plugin-barcodescanner.d.ts" />
|
||||
|
||||
cordova.plugins.barcodeScanner.scan(
|
||||
function (result) {
|
||||
alert("We got a barcode\n" +
|
||||
"Result: " + result.text + "\n" +
|
||||
"Format: " + result.format + "\n" +
|
||||
"Cancelled: " + result.cancelled);
|
||||
},
|
||||
function (error) {
|
||||
alert("Scanning failed: " + error);
|
||||
},
|
||||
{
|
||||
"preferFrontCamera" : true, // iOS and Android
|
||||
"showFlipCameraButton" : true, // iOS and Android
|
||||
"prompt" : "Place a barcode inside the scan area", // supported on Android only
|
||||
"formats" : "QR_CODE,PDF_417", // default: all but PDF_417 and RSS_EXPANDED
|
||||
"orientation" : "landscape" // Android only (portrait|landscape), default unset so it rotates with the device
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
cordova.plugins.barcodeScanner.encode(cordova.plugins.barcodeScanner.Encode.TEXT_TYPE, "http://www.nytimes.com", function(success) {
|
||||
alert("encode success: " + success);
|
||||
}, function(fail) {
|
||||
alert("encoding failed: " + fail);
|
||||
}
|
||||
);
|
||||
@@ -0,0 +1,37 @@
|
||||
// Type definitions for phonegap-plugin-barcodescanner
|
||||
// Project: https://github.com/phonegap/phonegap-plugin-barcodescanner
|
||||
// Definitions by: Nathan Ainslie <https://www.github.com/nainslie>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
interface CordovaPlugins {
|
||||
barcodeScanner: phonegapBarcode.BarcodeScanner;
|
||||
}
|
||||
|
||||
declare namespace phonegapBarcode {
|
||||
interface BarcodeScanResult {
|
||||
text: string;
|
||||
format: string;
|
||||
cancelled: boolean;
|
||||
}
|
||||
|
||||
interface BarcodeScanOptions {
|
||||
preferFrontCamera?: boolean;
|
||||
showFlipCameraButton?: boolean;
|
||||
prompt?: string;
|
||||
formats?: string;
|
||||
orientation?: "landscape" | "portrait";
|
||||
}
|
||||
|
||||
interface EncodingType {
|
||||
TEXT_TYPE: any;
|
||||
EMAIL_TYPE: any;
|
||||
PHONE_TYPE: any;
|
||||
SMS_TYPE: any;
|
||||
}
|
||||
|
||||
interface BarcodeScanner {
|
||||
scan: (success: ((result: BarcodeScanResult) => any), failure?: ((err: any) => any), opts?: BarcodeScanOptions) => void;
|
||||
encode: (encodingType: EncodingType, data: string, success: ((result: any) => any), failure?: ((err: any) => any)) => void;
|
||||
Encode: EncodingType;
|
||||
}
|
||||
}
|
||||
@@ -26,6 +26,12 @@ var instance = PINO({
|
||||
}
|
||||
})
|
||||
|
||||
var pretty = PINO.pretty()
|
||||
var instance2 = PINO({
|
||||
name: 'app',
|
||||
safe: true
|
||||
}, pretty)
|
||||
|
||||
|
||||
var logger = instance
|
||||
logger.child({ a: 'property' }).info('hello child!')
|
||||
|
||||
Vendored
+2
-2
@@ -41,8 +41,8 @@ declare module 'pino' {
|
||||
}
|
||||
|
||||
interface Pino {
|
||||
(optionsOrStream?: LoggerOptions | stream.Writable): Logger
|
||||
(options: LoggerOptions, stream: stream.Writable): Logger
|
||||
(optionsOrStream?: LoggerOptions | stream.Writable | stream.Readable): Logger
|
||||
(options: LoggerOptions, stream: stream.Writable | stream.Readable): Logger
|
||||
levels: {
|
||||
values: LevelLabelsToValues
|
||||
labels: LevelValuesToLabels
|
||||
|
||||
Vendored
+5
@@ -114,6 +114,11 @@ declare module "progress"
|
||||
* Terminates a progress bar.
|
||||
*/
|
||||
terminate():void;
|
||||
|
||||
/**
|
||||
* Completed status of progress (Boolean)
|
||||
*/
|
||||
complete:boolean;
|
||||
}
|
||||
namespace ProgressBar { }
|
||||
|
||||
|
||||
+51
-50
@@ -1,10 +1,6 @@
|
||||
/// <reference path="quill.d.ts" />
|
||||
/// <reference path="../requirejs/require.d.ts"/>
|
||||
|
||||
//export var Quill = require("quill");
|
||||
|
||||
function test_quill() {
|
||||
|
||||
var quillEditor = new Quill('#editor', {
|
||||
modules:
|
||||
{
|
||||
@@ -14,6 +10,31 @@ function test_quill() {
|
||||
});
|
||||
}
|
||||
|
||||
function test_deleteText() {
|
||||
var quillEditor = new Quill('#editor');
|
||||
quillEditor.deleteText(0, 10);
|
||||
}
|
||||
|
||||
function test_disable() {
|
||||
let quillEditor = new Quill('#Editor');
|
||||
quillEditor.disable();
|
||||
}
|
||||
|
||||
function test_enable() {
|
||||
let quillEditor = new Quill('#Editor');
|
||||
quillEditor.enable();
|
||||
}
|
||||
|
||||
function test_getContents() {
|
||||
var quillEditor = new Quill('#editor');
|
||||
var delta: QuillJS.DeltaStatic = quillEditor.getContents();
|
||||
}
|
||||
|
||||
function test_getLength() {
|
||||
var quillEditor = new Quill('#editor');
|
||||
var num: number = quillEditor.getLength();
|
||||
}
|
||||
|
||||
function test_getText() {
|
||||
var quillEditor = new Quill('#editor');
|
||||
var strValue: string = quillEditor.getText();
|
||||
@@ -29,26 +50,11 @@ function test_getText_substring() {
|
||||
var strValue: string = quillEditor.getText(0, 10);
|
||||
}
|
||||
|
||||
function test_getLength() {
|
||||
var quillEditor = new Quill('#editor');
|
||||
var num: number = quillEditor.getLength();
|
||||
}
|
||||
|
||||
function test_getContents() {
|
||||
var quillEditor = new Quill('#editor');
|
||||
var delta: DeltaStatic = quillEditor.getContents();
|
||||
}
|
||||
|
||||
function test_insertText() {
|
||||
var quillEditor = new Quill('#editor');
|
||||
quillEditor.insertText(0, "Hello World");
|
||||
}
|
||||
|
||||
function test_deleteText() {
|
||||
var quillEditor = new Quill('#editor');
|
||||
quillEditor.deleteText(0, 10);
|
||||
}
|
||||
|
||||
function test_formatText() {
|
||||
var quillEditor = new Quill('#editor');
|
||||
quillEditor.formatText(0, 5, 'bold', true);
|
||||
@@ -63,15 +69,28 @@ function test_formatText2() {
|
||||
});
|
||||
}
|
||||
|
||||
function test_formatLine() {
|
||||
function test_formatLine1() {
|
||||
var quillEditor = new Quill('#editor');
|
||||
quillEditor.formatLine(1, 3, 'api');
|
||||
}
|
||||
|
||||
function test_formatLine2() {
|
||||
var quillEditor = new Quill('#editor');
|
||||
quillEditor.formatLine(1, 3, 'align', 'right');
|
||||
}
|
||||
|
||||
function test_formatLine3() {
|
||||
var quillEditor = new Quill('#editor');
|
||||
quillEditor.formatLine(1, 3, {
|
||||
'align': 'right',
|
||||
'bold': false,
|
||||
});
|
||||
}
|
||||
|
||||
function test_insertEmbed() {
|
||||
var quillEditor = new Quill('#editor');
|
||||
|
||||
quillEditor.insertEmbed(10, 'image', 'http://quilljs.com/images/cloud.png');
|
||||
quillEditor.insertEmbed(10, 'image', 'http://com/images/cloud.png');
|
||||
}
|
||||
|
||||
function test_updateContents() {
|
||||
@@ -96,12 +115,6 @@ function test_setContents() {
|
||||
]);
|
||||
}
|
||||
|
||||
function test_setHTML() {
|
||||
var quillEditor = new Quill('#editor');
|
||||
|
||||
quillEditor.setHTML('<div>Hello</div>');
|
||||
}
|
||||
|
||||
function test_setText() {
|
||||
var quillEditor = new Quill('#editor');
|
||||
quillEditor.setText('Hello\n');
|
||||
@@ -113,10 +126,10 @@ function test_getSelection() {
|
||||
|
||||
var range = quillEditor.getSelection();
|
||||
if (range) {
|
||||
if (range.start == range.end) {
|
||||
console.log('User cursor is at index', range.start);
|
||||
if (range.index == range.length) {
|
||||
console.log('User cursor is at index', range.index);
|
||||
} else {
|
||||
var text = quillEditor.getText(range.start, range.end);
|
||||
var text = quillEditor.getText(range.index, range.length);
|
||||
console.log('User has highlighted: ', text);
|
||||
}
|
||||
} else {
|
||||
@@ -129,11 +142,6 @@ function test_setSelection() {
|
||||
quillEditor.setSelection(0, 5);
|
||||
}
|
||||
|
||||
function test_prepareFormat() {
|
||||
var quillEditor = new Quill('#editor');
|
||||
quillEditor.prepareFormat('bold', true);
|
||||
}
|
||||
|
||||
function test_focus() {
|
||||
var quillEditor = new Quill('#editor');
|
||||
quillEditor.focus();
|
||||
@@ -144,14 +152,6 @@ function test_getBounds() {
|
||||
quillEditor.setText('Hello\nWorld\n');
|
||||
}
|
||||
|
||||
function test_addModule() {
|
||||
var quillEditor = new Quill('#editor');
|
||||
|
||||
var toolbar = quillEditor.addModule('toolbar', {
|
||||
container: '#toolbar-container'
|
||||
});
|
||||
}
|
||||
|
||||
function test_getModule()
|
||||
{
|
||||
var quillEditor = new Quill('#editor');
|
||||
@@ -159,15 +159,16 @@ function test_getModule()
|
||||
var toolbar = quillEditor.getModule('toolbar');
|
||||
}
|
||||
|
||||
|
||||
function test_addFormat()
|
||||
{
|
||||
var quillEditor = new Quill('#editor');
|
||||
quillEditor.addFormat('strike', { tag: 'S', prepare: 'strikeThrough' });
|
||||
}
|
||||
|
||||
function test_addContainer()
|
||||
{
|
||||
var quillEditor = new Quill('#editor');
|
||||
quillEditor.addContainer('ql-custom');
|
||||
}
|
||||
|
||||
function test_on_EventType1(){
|
||||
var quillEditor = new Quill('#editor');
|
||||
quillEditor.on('text-change', (newDelta, oldDelta, source)=>{
|
||||
// happened
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
Vendored
+84
-108
@@ -1,118 +1,94 @@
|
||||
// Type definitions for Quill
|
||||
// Type definitions for Quill v1.0.0
|
||||
// Project: http://quilljs.com
|
||||
// Definitions by: Sumit <https://github.com/sumitkm>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
///<reference path="../eventemitter2/eventemitter2.d.ts" />
|
||||
declare namespace QuillJS {
|
||||
|
||||
declare interface DeltaStatic{
|
||||
ops? : Array<any>;
|
||||
retain?: any,
|
||||
delete?: any,
|
||||
insert?: any,
|
||||
attributes?: any
|
||||
export interface QuillOptionsStatic {
|
||||
debug?: string,
|
||||
modules?: { [key: string]: any },
|
||||
placeholder?: string,
|
||||
readOnly?: boolean,
|
||||
theme?: string
|
||||
}
|
||||
|
||||
export interface BoundsStatic {
|
||||
left: number,
|
||||
top: number,
|
||||
height: number,
|
||||
width: number
|
||||
}
|
||||
|
||||
export interface DeltaStatic {
|
||||
ops?: Array<any>;
|
||||
retain?: any,
|
||||
delete?: any,
|
||||
insert?: any,
|
||||
attributes?: any
|
||||
}
|
||||
|
||||
export interface RangeStatic {
|
||||
new (): RangeStatic;
|
||||
index: number;
|
||||
length: number;
|
||||
}
|
||||
|
||||
type sourceType = "api" | "user" | "silent";
|
||||
type formatsType = { [key: string]: any };
|
||||
|
||||
export interface QuillStatic {
|
||||
new (selector: string, options?: QuillOptionsStatic): QuillStatic;
|
||||
deleteText(start: number, end: number, source?: sourceType): void;
|
||||
disable(): void;
|
||||
enable(enabled?: boolean): void;
|
||||
getContents(start?: number, end?: number): DeltaStatic;
|
||||
getLength(): number;
|
||||
getText(start?: number, end?: number): string;
|
||||
insertEmbed(index: number, type: string, url: string, source?: sourceType): void;
|
||||
insertText(index: number, text: string, source?: sourceType): void;
|
||||
insertText(index: number, text: string, format: string, value: string, source?: sourceType): void;
|
||||
insertText(index: number, text: string, formats: formatsType, source?: sourceType): void;
|
||||
pasteHTML(): string;
|
||||
setContents(delta: DeltaStatic, source?: sourceType): void;
|
||||
setText(text: string, source?: sourceType): void;
|
||||
update(source?: string): void;
|
||||
updateContents(delta: DeltaStatic, source?: sourceType): void;
|
||||
|
||||
format(name: string, value: any, source?: sourceType): void;
|
||||
formatLine(index: number, length: number, source?: sourceType): void;
|
||||
formatLine(index: number, length: number, format: string, value: any, source?: sourceType): void;
|
||||
formatLine(index: number, length: number, formats: formatsType, source?: sourceType): void;
|
||||
formatText(index: number, length: number, source?: sourceType): void;
|
||||
formatText(index: number, length: number, format: string, value: any, source?: sourceType): void;
|
||||
formatText(index: number, length: number, formats: formatsType, source?: sourceType): void;
|
||||
getFormat(range?: RangeStatic): formatsType;
|
||||
getFormat(index: number, length?: number): formatsType;
|
||||
removeFormat(index: Number, length: Number, source?: sourceType): void;
|
||||
|
||||
blur(): void;
|
||||
focus(): void;
|
||||
getBounds(index: number, length?: number): BoundsStatic;
|
||||
getSelection(focus?: boolean): RangeStatic;
|
||||
hasFocus(): boolean;
|
||||
setSelection(index: number, length: number, source?: sourceType): void;
|
||||
setSelection(range: RangeStatic, source?: sourceType): void;
|
||||
|
||||
on(eventName: string, callback: (<T>(delta: T, oldContents: T, source: string) => void) |
|
||||
((name: string, ...args: any[]) => void)): QuillStatic;
|
||||
once(eventName: string, callback: (delta: DeltaStatic, source: string) => void): QuillStatic;
|
||||
off(eventName: string, callback: (delta: DeltaStatic, source: string) => void): QuillStatic;
|
||||
|
||||
debug(level: string): void;
|
||||
import(path: string): any;
|
||||
register(path: string, def: any, suppressWarning?: boolean): void;
|
||||
register(defs: formatsType, suppressWarning?: boolean): void;
|
||||
addContainer(className: string, refNode?: any): any;
|
||||
getModule(name: string): any
|
||||
}
|
||||
}
|
||||
|
||||
declare interface RangeStatic{
|
||||
new(): RangeStatic;
|
||||
start: number;
|
||||
end: number;
|
||||
}
|
||||
|
||||
declare interface QuillStatic {
|
||||
new(selector: string, options?: Object):QuillStatic;
|
||||
|
||||
on(eventName: string, callback: (delta: DeltaStatic, source: string) => void): EventEmitter2;
|
||||
addModule(id: string, options: any) : Object;
|
||||
|
||||
getText(): string;
|
||||
getText(start: number): string;
|
||||
getText(start: number, end: number): string;
|
||||
|
||||
getLength(): number;
|
||||
|
||||
getContents(): DeltaStatic;
|
||||
getContents(start: number): DeltaStatic;
|
||||
getContents(start: number, end: number): DeltaStatic;
|
||||
|
||||
getHTML(): string;
|
||||
|
||||
insertText(index: number, text: string): void;
|
||||
insertText(index: number, text: string, name: string, value: string): void;
|
||||
insertText(index: number, text: string, formats: any): void;
|
||||
insertText(index: number, text: string, source: string) : void;
|
||||
insertText(index: number, text: string, name: string, value: string, source: string): void;
|
||||
insertText(index: number, text: string, formats: any, source: string): void;
|
||||
|
||||
deleteText(start: number, end: number): void;
|
||||
deleteText(start: number, end: number, source: string): void;
|
||||
|
||||
formatText(start: number, end: number): void;
|
||||
formatText(start: number, end: number, name: string, value: boolean): void;
|
||||
formatText(start: number, end: number, formats: any): void;
|
||||
formatText(start: number, end: number, source: string): void;
|
||||
formatText(start: number, end: number, name: string, value: string, source: string): void;
|
||||
formatText(start: number, end: number, formats: string, source: string): void;
|
||||
|
||||
|
||||
formatLine(start: number, end: number): void;
|
||||
formatLine(start: number, end: number, name: string, value: boolean): void;
|
||||
formatLine(start: number, end: number, formats: any): void;
|
||||
formatLine(start: number, end: number, source: string): void;
|
||||
formatLine(start: number, end: number, name: string, value: string, source: string): void;
|
||||
formatLine(start: number, end: number, formats: any, source: string): void;
|
||||
|
||||
|
||||
insertEmbed(index: number, type: string, url: string): void;
|
||||
insertEmbed(index: number, type: string, url: string, source: string): void;
|
||||
|
||||
updateContents(delta: DeltaStatic): void;
|
||||
|
||||
setContents(delta: DeltaStatic): void;
|
||||
|
||||
setHTML(html: string): void;
|
||||
|
||||
setText(text: string): void;
|
||||
|
||||
getSelection(): RangeStatic;
|
||||
|
||||
setSelection(start: number, end: number): void;
|
||||
setSelection(start: number, end: number, source: string): void;
|
||||
setSelection(range: RangeStatic): void;
|
||||
setSelection(range: RangeStatic, source: string): void;
|
||||
|
||||
prepareFormat(format: string, value: boolean): void;
|
||||
|
||||
focus(): void;
|
||||
|
||||
getBounds(index: number): any;
|
||||
|
||||
registerModule(name: string, callback: (quill: QuillStatic, options: any) => {}): any;
|
||||
|
||||
addModule(name: string, options: any): any;
|
||||
|
||||
getModule(name: string): any;
|
||||
|
||||
onModuleLoad(name: string, callback: (input: any) => {}): void;
|
||||
|
||||
addFormat(name: string, config: any): void;
|
||||
|
||||
addContainer(cssClass: string, before?: number): HTMLDivElement;
|
||||
}
|
||||
|
||||
declare module "Range"
|
||||
{
|
||||
var Range: RangeStatic;
|
||||
export = Range;
|
||||
}
|
||||
|
||||
declare var Delta: DeltaStatic;
|
||||
|
||||
declare module "Delta"{
|
||||
export = Delta;
|
||||
}
|
||||
|
||||
declare var Quill: QuillStatic;
|
||||
declare var Quill: QuillJS.QuillStatic;
|
||||
|
||||
declare module "Quill" {
|
||||
export = Quill;
|
||||
|
||||
@@ -43,6 +43,12 @@ class TestComponentWithConfig extends React.Component<{ a?: number }, {}> {
|
||||
}}
|
||||
>
|
||||
</Style>
|
||||
<Style scopeSelector="test"
|
||||
rules={{
|
||||
background: "green"
|
||||
}}
|
||||
>
|
||||
</Style>
|
||||
</Radium.StyleRoot>
|
||||
</div>
|
||||
)
|
||||
|
||||
Vendored
+5
-5
@@ -1,6 +1,6 @@
|
||||
// Type definitions for radium 0.17.1
|
||||
// Type definitions for radium 0.18.1
|
||||
// Project: https://github.com/formidablelabs/radium
|
||||
// Definitions by: Alex Gorbatchev <https://github.com/alexgorbatchev/>, Philipp Holzer <https://github.com/nupplaphil/>, Alexey Svetliakov <https://github.com/asvetliakov/>
|
||||
// Definitions by: Alex Gorbatchev <https://github.com/alexgorbatchev/>, Philipp Holzer <https://github.com/nupplaphil/>, Alexey Svetliakov <https://github.com/asvetliakov/>, Mikael Hermansson <https://github.com/mihe/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference path="../react/react.d.ts"/>
|
||||
@@ -19,10 +19,10 @@ declare module 'radium' {
|
||||
*/
|
||||
export interface StyleProps {
|
||||
/**
|
||||
* An object of CSS rules to render. Each key of the rules object is a CSS selector and the value is an object
|
||||
* of styles. If rules is empty, the component will render nothing.
|
||||
* An object of styles, or an object of CSS rules to render. Each key of the rules object is a CSS
|
||||
* selector and the value is an object of styles. If rules is empty, the component will render nothing.
|
||||
*/
|
||||
rules: StyleRules;
|
||||
rules: React.CSSProperties | StyleRules;
|
||||
/**
|
||||
* A string that any included selectors in rules will be appended to.
|
||||
* Use to scope styles in the component to a particular element. A good use case might be to generate a unique
|
||||
|
||||
@@ -44,3 +44,5 @@ Raven.setUserContext({
|
||||
|
||||
Raven.captureMessage('Broken!');
|
||||
Raven.captureMessage('Broken!', {tags: { key: "value" }});
|
||||
|
||||
Raven.showReportDialog(options);
|
||||
|
||||
Vendored
+2
@@ -183,6 +183,8 @@ interface RavenStatic {
|
||||
|
||||
/** If you need to conditionally check if raven needs to be initialized or not, you can use the isSetup function. It will return true if Raven is already initialized. */
|
||||
isSetup(): boolean;
|
||||
|
||||
showReportDialog(options: RavenOptions): void;
|
||||
}
|
||||
|
||||
interface RavenTransportOptions {
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
/// <reference path="rbush.d.ts" />
|
||||
|
||||
import * as rbush from 'rbush';
|
||||
|
||||
interface IndexedRect extends rbush.BBox {
|
||||
index: number;
|
||||
}
|
||||
|
||||
function test_rbush() {
|
||||
var index = rbush<IndexedRect>();
|
||||
|
||||
index
|
||||
.clear()
|
||||
.insert({
|
||||
minX: 0,
|
||||
minY: 0,
|
||||
maxX: 10,
|
||||
maxY: 10,
|
||||
index: 0,
|
||||
});
|
||||
|
||||
index.all();
|
||||
index.fromJSON(index.toJSON());
|
||||
|
||||
index.search({
|
||||
minX: 5,
|
||||
maxX: 15,
|
||||
minY: 5,
|
||||
maxY: 11,
|
||||
})
|
||||
|
||||
index.load([
|
||||
{
|
||||
minX: 0,
|
||||
minY: 0,
|
||||
maxX: 10,
|
||||
maxY: 10,
|
||||
index: 0,
|
||||
}
|
||||
])
|
||||
}
|
||||
Vendored
+110
@@ -0,0 +1,110 @@
|
||||
// Type definitions for rbush 2.0.1
|
||||
// Project: https://github.com/mourner/rbush
|
||||
// Definitions by: Dan Vanderkam <http://danvk.org/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare namespace rbush {
|
||||
export interface BBox {
|
||||
minX: number;
|
||||
minY: number;
|
||||
maxX: number;
|
||||
maxY: number;
|
||||
}
|
||||
|
||||
export interface RBush<T> {
|
||||
/**
|
||||
* Insert an item. To insert many items, use load().
|
||||
*/
|
||||
insert(item: T): RBush<T>;
|
||||
|
||||
/**
|
||||
* Bulk-insert the given data into the tree.
|
||||
*
|
||||
* Bulk insertion is usually ~2-3 times faster than inserting items one by one.
|
||||
* After bulk loading (bulk insertion into an empty tree), subsequent query
|
||||
* performance is also ~20-30% better.
|
||||
*
|
||||
* Note that when you do bulk insertion into an existing tree, it bulk-loads
|
||||
* the given data into a separate tree and inserts the smaller tree into the
|
||||
* larger tree. This means that bulk insertion works very well for clustered
|
||||
* data (where items in one update are close to each other), but makes query
|
||||
* performance worse if the data is scattered.
|
||||
*/
|
||||
load(items: T[]): RBush<T>;
|
||||
|
||||
/**
|
||||
* Remove a previously inserted item.
|
||||
*
|
||||
* By default, RBush removes objects by reference. However, you can pass a
|
||||
* custom equals function to compare by value for removal, which is useful
|
||||
* when you only have a copy of the object you need removed (e.g. loaded
|
||||
* from server).
|
||||
*/
|
||||
remove(item: T, equals?: (a: T, b: T) => boolean): RBush<T>;
|
||||
|
||||
/** Remove all items */
|
||||
clear(): RBush<T>;
|
||||
|
||||
/**
|
||||
* Returns an array of data items (points or rectangles) that the given
|
||||
* bounding box intersects.
|
||||
*
|
||||
* Note that the search method accepts a bounding box in {minX, minY, maxX, maxY}
|
||||
* format regardless of the format specified in the constructor (which only
|
||||
* affects inserted objects).
|
||||
*/
|
||||
search(bbox: BBox): T[];
|
||||
|
||||
/** Returns all items of the tree. */
|
||||
all(): T[];
|
||||
|
||||
/**
|
||||
* Returns true if there are any items intersecting the given bounding box,
|
||||
* otherwise false.
|
||||
*/
|
||||
collides(bbox: BBox): boolean;
|
||||
|
||||
/**
|
||||
* Export data as JSON object.
|
||||
*
|
||||
* Importing and exporting as JSON allows you to use RBush on both the server
|
||||
* (using Node.js) and the browser combined, e.g. first indexing the data on
|
||||
* the server and and then importing the resulting tree data on the client
|
||||
* for searching.
|
||||
*
|
||||
* Note that the nodeSize option passed to the constructor must be the same
|
||||
* in both trees for export/import to work properly.
|
||||
*/
|
||||
toJSON(): any;
|
||||
|
||||
/**
|
||||
* Import previously exported data.
|
||||
*
|
||||
* Importing and exporting as JSON allows you to use RBush on both the server
|
||||
* (using Node.js) and the browser combined, e.g. first indexing the data on
|
||||
* the server and and then importing the resulting tree data on the client
|
||||
* for searching.
|
||||
*
|
||||
* Note that the nodeSize option passed to the constructor must be the same
|
||||
* in both trees for export/import to work properly.
|
||||
*/
|
||||
fromJSON(data: any): RBush<T>;
|
||||
}
|
||||
|
||||
interface IRBush {
|
||||
/**
|
||||
* Create a spatial index.
|
||||
*
|
||||
* An optional argument to rbush defines the maximum number of entries in a tree node.
|
||||
* 9 (used by default) is a reasonable choice for most applications. Higher value means\
|
||||
* faster insertion and slower search, and vice versa.
|
||||
*/
|
||||
<T extends BBox>(nodeSize?: number): RBush<T>;
|
||||
<T>(nodeSize: number, formatter: string[]): RBush<T>;
|
||||
}
|
||||
}
|
||||
|
||||
declare module 'rbush' {
|
||||
const temp: rbush.IRBush;
|
||||
export = temp;
|
||||
}
|
||||
@@ -0,0 +1,178 @@
|
||||
/// <reference path="react-daterange-picker.d.ts" />
|
||||
/// <reference path="../react/react-global.d.ts" />
|
||||
|
||||
// Test app from https://github.com/onefinestay/react-daterange-picker/blob/master/example/index.jsx
|
||||
import * as React from 'react';
|
||||
import * as ReactDOM from 'react-dom';
|
||||
import * as moment from 'moment';
|
||||
import 'moment-range';
|
||||
import * as DateRangePicker from 'react-daterange-picker';
|
||||
|
||||
interface AppProps extends ReactDateRangePicker.Props {
|
||||
}
|
||||
|
||||
class App extends React.Component<AppProps, any> {
|
||||
constructor(props: AppProps, context: any) {
|
||||
super(props, context);
|
||||
|
||||
this.state = {};
|
||||
}
|
||||
|
||||
handleSelect(value: AppProps, states: any): void {
|
||||
this.setState({value, states});
|
||||
}
|
||||
|
||||
render(): any {
|
||||
return (
|
||||
<div>
|
||||
<DateRangePicker {...this.props}
|
||||
onSelect={this.handleSelect.bind(this)}
|
||||
value={this.state.value} />
|
||||
<div>
|
||||
<input type="text"
|
||||
value={this.state.value ? this.state.value.start.format('LL') : ""}
|
||||
readOnly={true}
|
||||
placeholder="Start date"/>
|
||||
<input type="text"
|
||||
value={this.state.value ? this.state.value.end.format('LL') : ""}
|
||||
readOnly={true}
|
||||
placeholder="End date" />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class DateSinglePicker extends React.Component<AppProps, any> {
|
||||
constructor(props : AppProps, context: any) {
|
||||
super(props, context);
|
||||
|
||||
this.state = {};
|
||||
}
|
||||
|
||||
handleSelect(value: AppProps) {
|
||||
this.setState({value: value});
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div>
|
||||
<DateRangePicker {...this.props} onSelect={this.handleSelect.bind(this)}
|
||||
value={this.state.value} />
|
||||
<div>
|
||||
<input type="text"
|
||||
value={this.state.value ? this.state.value.format('LL') : ""}
|
||||
readOnly={true} />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export class Main extends React.Component<any, any> {
|
||||
|
||||
render() {
|
||||
const stateDefinitions: ReactDateRangePicker.StateDefinitions = {
|
||||
available: {
|
||||
color: '#ffffff',
|
||||
label: 'Available',
|
||||
},
|
||||
enquire: {
|
||||
color: '#ffd200',
|
||||
label: 'Enquire',
|
||||
},
|
||||
unavailable: {
|
||||
selectable: false,
|
||||
color: '#78818b',
|
||||
label: 'Unavailable',
|
||||
}
|
||||
};
|
||||
|
||||
const dateRanges = [
|
||||
{
|
||||
state: 'enquire',
|
||||
range: moment.range(
|
||||
moment().add(2, 'weeks').subtract(5, 'days'),
|
||||
moment().add(2, 'weeks').add(6, 'days')
|
||||
),
|
||||
},
|
||||
{
|
||||
state: 'unavailable',
|
||||
range: moment.range(
|
||||
moment().add(3, 'weeks'),
|
||||
moment().add(3, 'weeks').add(5, 'days')
|
||||
),
|
||||
},
|
||||
];
|
||||
|
||||
const initialStart = moment().add(1, 'weeks').startOf('day');
|
||||
const initialEnd = moment().add(1, 'weeks').add(3, 'days').startOf('day');
|
||||
const range = moment.range(initialStart, initialEnd);
|
||||
|
||||
return (
|
||||
<div className="content">
|
||||
<div className="example">
|
||||
<App
|
||||
firstOfWeek={1}
|
||||
numberOfCalendars={2}
|
||||
selectionType='range'
|
||||
minimumDate={new Date()}
|
||||
maximumDate={moment().add(2, 'years').toDate()}
|
||||
stateDefinitions={stateDefinitions}
|
||||
dateStates={dateRanges}
|
||||
defaultState="available"
|
||||
value={range}
|
||||
showLegend={true}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="examples">
|
||||
<h2>Examples</h2>
|
||||
|
||||
<div className="example">
|
||||
<h4>Range with no date states</h4>
|
||||
<App
|
||||
numberOfCalendars={2}
|
||||
selectionType="range"
|
||||
minimumDate={new Date()}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="example">
|
||||
<h4>Range with day-long ranges allowed</h4>
|
||||
<App
|
||||
numberOfCalendars={2}
|
||||
selectionType="range"
|
||||
singleDateRange={true}
|
||||
minimumDate={new Date()}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="example">
|
||||
<h4>Range with no minimum date</h4>
|
||||
<App
|
||||
numberOfCalendars={2}
|
||||
selectionType="range"
|
||||
singleDateRange={true}
|
||||
/>
|
||||
</div>
|
||||
<div className="example">
|
||||
<h4>Single with no date states</h4>
|
||||
<DateSinglePicker
|
||||
numberOfCalendars={2}
|
||||
selectionType="single"
|
||||
minimumDate={new Date()}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const MainFactory = React.createFactory(Main);
|
||||
|
||||
ReactDOM.render(
|
||||
MainFactory(),
|
||||
document.getElementById('app')
|
||||
);
|
||||
@@ -0,0 +1,77 @@
|
||||
// Type definitions for React Daterange Picker v1.1.0
|
||||
// Project: https://github.com/onefinestay/react-daterange-picker
|
||||
// Definitions by: UNCOVER TRUTH Inc. <https://github.com/uncovertruth/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../react/react.d.ts" />
|
||||
/// <reference path="../moment/moment.d.ts" />
|
||||
/// <reference path="../moment-range/moment-range.d.ts" />
|
||||
|
||||
declare module 'react-daterange-picker' {
|
||||
import DateRangePicker = ReactDateRangePicker.DateRangePicker;
|
||||
export = DateRangePicker;
|
||||
}
|
||||
|
||||
declare namespace ReactDateRangePicker {
|
||||
import React = __React;
|
||||
|
||||
interface Props extends React.Props<{}> {
|
||||
bemBlock?: string;
|
||||
bemNamespace?: string;
|
||||
dateStates?: DateState[];
|
||||
defaultState?: string;
|
||||
disableNavigation?: boolean;
|
||||
// Use Number Literal Types after TypeScript 2.0 GA released.
|
||||
firstOfWeek?: number; // React.PropTypes.oneOf([0, 1, 2, 3, 4, 5, 6])
|
||||
helpMessage?: string;
|
||||
initialFromValue?: boolean;
|
||||
initialDate?: Date;
|
||||
initialMonth?: number;
|
||||
initialYear?: number;
|
||||
initialRange?: {};
|
||||
maximumDate?: Date;
|
||||
minimumDate?: Date;
|
||||
numberOfCalendars?: number;
|
||||
onHighlightDate?(date: Date): void;
|
||||
onHighlightRange?(date: Date): void;
|
||||
onSelect?(value: Props): void;
|
||||
onSelectStart?(value: moment.Moment): void;
|
||||
paginationArrowComponent?: PaginationArrow;
|
||||
selectedLabel?: string;
|
||||
selectionType?: 'single' |'range';
|
||||
singleDateRange?: boolean;
|
||||
showLegend?: boolean;
|
||||
stateDefinitions?: StateDefinitions;
|
||||
value?: moment.Moment | moment.Range;
|
||||
}
|
||||
|
||||
interface DateState {
|
||||
state: string;
|
||||
range: moment.Range;
|
||||
}
|
||||
|
||||
interface StateDefinitions {
|
||||
[key: string]: StateDefinition;
|
||||
}
|
||||
|
||||
interface StateDefinition {
|
||||
color: string;
|
||||
label: string;
|
||||
selectable?: boolean;
|
||||
}
|
||||
|
||||
interface PaginationArrowProps extends React.Props<{}> {
|
||||
disabled?: boolean;
|
||||
onTrigger?(): void;
|
||||
direction?: 'next' | 'previous';
|
||||
}
|
||||
|
||||
class PaginationArrow extends React.Component<PaginationArrowProps, {}> {
|
||||
}
|
||||
|
||||
class DateRangePicker extends React.Component<Props, {}> {
|
||||
}
|
||||
|
||||
namespace DateRangePicker {
|
||||
}
|
||||
}
|
||||
Vendored
+4
-2
@@ -11,6 +11,8 @@ declare module 'redux-form' {
|
||||
import { Component, SyntheticEvent, FormEventHandler } from 'react';
|
||||
import { Dispatch, ActionCreator, Reducer } from 'redux';
|
||||
|
||||
export const actionTypes: {[actionName:string]: string};
|
||||
|
||||
export type FieldValue = any;
|
||||
|
||||
export type FormData = {[fieldName:string]: FieldValue};
|
||||
@@ -39,7 +41,7 @@ declare module 'redux-form' {
|
||||
* The error for this field if its value is not passing validation. Both
|
||||
* synchronous and asynchronous validation errors will be reported here.
|
||||
*/
|
||||
error?: string[];
|
||||
error?: any;
|
||||
|
||||
/**
|
||||
* The value for this field as supplied in initialValues to the form.
|
||||
@@ -163,7 +165,7 @@ declare module 'redux-form' {
|
||||
* result from the synchronous validation function, the asynchronous
|
||||
* validation, or the rejected promise from onSubmit.
|
||||
*/
|
||||
error?: string[];
|
||||
error?: any;
|
||||
|
||||
/**
|
||||
* The form data, in the form { field1: <Object>, field2: <Object> }. The
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/// <reference path="./redux-mock-store.d.ts" />
|
||||
|
||||
import configureStore from 'redux-mock-store';
|
||||
import configureStore, {IStore} from 'redux-mock-store';
|
||||
|
||||
// Redux store API tests
|
||||
// The following test are taken from ../redux/redux-tests.ts
|
||||
@@ -25,10 +25,11 @@ function loggingMiddleware() {
|
||||
};
|
||||
}
|
||||
|
||||
const storeMock = configureStore([loggingMiddleware]);
|
||||
const storeMock = configureStore<number>([loggingMiddleware]);
|
||||
const initialState = 0
|
||||
let store = storeMock(initialState);
|
||||
let store: IStore<number>;
|
||||
|
||||
store = storeMock(initialState);
|
||||
|
||||
store.subscribe(() => {
|
||||
// ...
|
||||
@@ -40,4 +41,4 @@ store.dispatch({ type: 'INCREMENT' });
|
||||
// Additional mock store API tests
|
||||
var actions: Array<any> = store.getActions();
|
||||
|
||||
store.clearActions();
|
||||
store.clearActions();
|
||||
|
||||
+3
-3
@@ -10,9 +10,9 @@ declare module 'redux-mock-store' {
|
||||
|
||||
function createMockStore<T>(middlewares?:Redux.Middleware[]):mockStore<T>
|
||||
|
||||
type mockStore<T> = (state?:T) => IStore<T>;
|
||||
export type mockStore<T> = (state?:T) => IStore<T>;
|
||||
|
||||
type IStore<T> = {
|
||||
export type IStore<T> = {
|
||||
dispatch(action: any):any
|
||||
getState():T
|
||||
getActions():Object[]
|
||||
@@ -21,4 +21,4 @@ declare module 'redux-mock-store' {
|
||||
}
|
||||
|
||||
export default createMockStore
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+1
@@ -23,6 +23,7 @@ declare module 'request-promise' {
|
||||
finally<TResult>(handler: () => PromiseLike<TResult>): Promise<any>;
|
||||
finally<TResult>(handler: () => TResult): Promise<any>;
|
||||
promise(): Promise<any>;
|
||||
cancel(): void;
|
||||
}
|
||||
|
||||
interface RequestPromiseOptions extends request.CoreOptions {
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
/// <reference path="resolve-from.d.ts" />
|
||||
|
||||
// Much better testing in https://github.com/typed-typings/typed-resolve-from
|
||||
if (typeof resolveFrom !== 'function') {
|
||||
throw new Error('resolveFrom is not a function');
|
||||
}
|
||||
import resolveFrom1 = require('resolve-from');
|
||||
import * as resolveFrom2 from 'resolve-from';
|
||||
|
||||
let from: string;
|
||||
let moduleId: string;
|
||||
let result: string;
|
||||
|
||||
result = resolveFrom1(from, moduleId);
|
||||
result = resolveFrom2(from, moduleId);
|
||||
|
||||
Vendored
+8
-2
@@ -1,9 +1,15 @@
|
||||
// Type definitions for resolve-from
|
||||
// Project: https://github.com/sindresorhus/resolve-from
|
||||
// Definitions by: unional <https://github.com/unional>
|
||||
// Definitions by: unional <https://github.com/unional>, tswaters <https://github.com/tswaters>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
declare function resolveFrom(fromDir: string, moduleId: string): string;
|
||||
|
||||
declare module "resolve-from" {
|
||||
|
||||
function resolveFrom(fromDir: string, moduleId: string): string;
|
||||
|
||||
namespace resolveFrom {
|
||||
|
||||
}
|
||||
|
||||
export = resolveFrom;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,95 @@
|
||||
/// <reference path="./revalidator.d.ts" />
|
||||
import revalidator = require('revalidator');
|
||||
|
||||
let someObject = {
|
||||
hello: true,
|
||||
there: 'string'
|
||||
};
|
||||
|
||||
let schema: Revalidator.JSONSchema<typeof someObject> = {
|
||||
|
||||
};
|
||||
|
||||
revalidator.validate(someObject, {
|
||||
properties: {
|
||||
url: {
|
||||
description: 'the url the object should be stored at',
|
||||
type: 'string',
|
||||
pattern: '^/[^#%&*{}\\:<>?\/+]+$',
|
||||
required: true
|
||||
},
|
||||
challenge: {
|
||||
description: 'a means of protecting data (insufficient for production, used as example)',
|
||||
type: 'string',
|
||||
minLength: 5
|
||||
},
|
||||
body: {
|
||||
description: 'what to store at the url',
|
||||
type: 'any',
|
||||
default: null
|
||||
},
|
||||
obj: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
title: {
|
||||
type: 'string',
|
||||
maxLength: 140,
|
||||
conditions: {
|
||||
optional: function () {
|
||||
return !this.published;
|
||||
}
|
||||
}
|
||||
},
|
||||
date: { type: 'string', format: 'date', messages: { format: "must be a valid %{expected} and nothing else" } },
|
||||
body: { type: 'string' },
|
||||
tags: {
|
||||
type: 'array',
|
||||
uniqueItems: true,
|
||||
minItems: 2,
|
||||
items: {
|
||||
type: 'string',
|
||||
pattern: /[a-z ]+/
|
||||
}
|
||||
},
|
||||
tuple: {
|
||||
type: 'array',
|
||||
minItems: 2,
|
||||
maxItems: 2,
|
||||
items: {
|
||||
type: ['string', 'number']
|
||||
}
|
||||
},
|
||||
author: { type: 'string', pattern: /^[\w ]+$/i, required: true, messages: { required: "is essential for survival" } },
|
||||
published: { type: 'boolean', 'default': false },
|
||||
category: { type: 'string' },
|
||||
palindrome: {
|
||||
type: 'string', conform: function (val) {
|
||||
return val == val.split("").reverse().join("");
|
||||
}
|
||||
},
|
||||
name: {
|
||||
type: 'string', default: '', conform: function (val, data) {
|
||||
return (val === data.hello);
|
||||
}
|
||||
}
|
||||
},
|
||||
patternProperties: {
|
||||
'^_': {
|
||||
type: 'boolean', default: false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}, {
|
||||
validateFormats: true,
|
||||
validateFormatsStrict: false,
|
||||
validateFormatExtensions: true,
|
||||
additionalProperties: false,
|
||||
cast: false
|
||||
}).valid === true;
|
||||
|
||||
revalidator.validate(null, null, null);
|
||||
Vendored
+71
-21
@@ -4,10 +4,27 @@
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare module Revalidator {
|
||||
interface RevalidatorStatic {
|
||||
validate(object: any, schema: ISchema, options: any): IReturnMessage;
|
||||
|
||||
interface IOptions {
|
||||
/** Enforce format constraints (default true) */
|
||||
validateFormats?: boolean;
|
||||
/** When validateFormats is true treat unrecognized formats as validation errors (default false) */
|
||||
validateFormatsStrict?: boolean;
|
||||
/** When validateFormats is true also validate formats defined in validate.formatExtensions (default true) */
|
||||
validateFormatExtensions?: boolean;
|
||||
/** When additionalProperties is true allow additional unvisited properties on the object. (default true) */
|
||||
additionalProperties?: boolean;
|
||||
/** Enforce casting of some types (for integers/numbers are only supported) when it's possible, e.g. "42" => 42, but "forty2" => "forty2" for the integer type. */
|
||||
cast?: boolean;
|
||||
}
|
||||
|
||||
interface RevalidatorStatic {
|
||||
validate<T>(object: T, schema: JSONSchema<T>, options?: IOptions): IReturnMessage;
|
||||
}
|
||||
|
||||
type Types = 'string' | 'number' | 'integer' | 'array' | 'boolean' | 'object' | 'null' | 'any';
|
||||
type Formats = 'url' | 'email' | 'ip-address' | 'ipv6' | 'date-time' | 'date' | 'time' | 'color' | 'host-name' | 'utc-millisec' | 'regex';
|
||||
|
||||
interface IErrrorProperty {
|
||||
property: string;
|
||||
message: string;
|
||||
@@ -18,26 +35,59 @@ declare module Revalidator {
|
||||
errors: IErrrorProperty[];
|
||||
}
|
||||
|
||||
interface ISchema {
|
||||
required?: boolean;
|
||||
type: string;
|
||||
pattern?: any;
|
||||
maxLength?: number;
|
||||
minLength?: number;
|
||||
minimum?: number;
|
||||
maximum?: number;
|
||||
allowEmpty: boolean;
|
||||
exclusiveMinimum: number;
|
||||
exclusiveMaximum?: number;
|
||||
divisibleBy?: number;
|
||||
minItems?: number;
|
||||
maxItems?: number;
|
||||
uniqueItems?: boolean;
|
||||
enum?: any;
|
||||
format?: string;
|
||||
conform?: (data:any) => boolean;
|
||||
depdendencies?: string;
|
||||
interface JSONSchema<T> {
|
||||
properties?: ISchemas<T>;
|
||||
}
|
||||
|
||||
interface ISchemas<T> {
|
||||
[index: string]: ISchema<T>|JSONSchema<T>;
|
||||
}
|
||||
|
||||
interface ISchema<T> {
|
||||
/**The type of value should be equal to the expected value */
|
||||
type: Types|Types[];
|
||||
/**If true, the value should not be undefined */
|
||||
required?: boolean;
|
||||
/**The expected value regex needs to be satisfied by the value */
|
||||
pattern?: RegExp|string;
|
||||
/**The length of value must be greater than or equal to expected value */
|
||||
maxLength?: number;
|
||||
/**Description for this object */
|
||||
description?: string;
|
||||
/**The length of value must be lesser than or equal to expected value */
|
||||
minLength?: number;
|
||||
/**Value must be greater than or equal to the expected value */
|
||||
minimum?: number;
|
||||
/**Value must be lesser than or equal to the expected value */
|
||||
maximum?: number;
|
||||
/**If false, the value must not be an empty string */
|
||||
allowEmpty?: boolean;
|
||||
/**Value must be greater than expected value */
|
||||
exclusiveMinimum?: number;
|
||||
/**Value must be lesser than expected value */
|
||||
exclusiveMaximum?: number;
|
||||
/**Value must be divisible by expected value */
|
||||
divisibleBy?: number;
|
||||
/**Value must contain more than expected number of items */
|
||||
minItems?: number;
|
||||
/**Value must contain fewer than expected number of items */
|
||||
maxItems?: number;
|
||||
/**Value must hold a unique set of values */
|
||||
uniqueItems?: boolean;
|
||||
/**Value must be present in the array of expected values */
|
||||
enum?: any[];
|
||||
/**Custom messages for different constraints */
|
||||
message?: string;
|
||||
/**Custom messages for different constraints */
|
||||
messages?: {[index: string]: string};
|
||||
/**Default value */
|
||||
default?: any;
|
||||
/**Value must be a valid format */
|
||||
format?: Formats;
|
||||
/**Value must conform to constraint denoted by expected value */
|
||||
conform?: (value: any, data?: T) => boolean;
|
||||
/**Value is valid only if the dependent value is valid */
|
||||
dependencies?: string;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Vendored
+2
-2
@@ -321,13 +321,13 @@ declare module "riot-api-nodejs" {
|
||||
* get league of legends status
|
||||
* @param {RiotGamesAPI.LolStatus.Shard[]} callback data callback
|
||||
*/
|
||||
getSatus(): Promise<RiotGamesAPI.LolStatus.Shard[]>;
|
||||
getStatus(): Promise<RiotGamesAPI.LolStatus.Shard[]>;
|
||||
/**
|
||||
* get status for a given region
|
||||
* @param {region_e} region region
|
||||
* @param {RiotGamesAPI.LolStatus.Shard} callback data callback
|
||||
*/
|
||||
getSatusByRegion(region: region_e): Promise<RiotGamesAPI.LolStatus.Shard>;
|
||||
getStatusByRegion(region: region_e): Promise<RiotGamesAPI.LolStatus.Shard>;
|
||||
/**
|
||||
* get match infos for a given match ID
|
||||
* @param {number} matchId Match ID
|
||||
|
||||
Vendored
+1
-1
@@ -752,7 +752,7 @@ declare namespace SocketIO {
|
||||
* A dictionary of all the rooms that we have in this namespace
|
||||
* The rooms are made of a `sockets` key which is the dictionary of sockets per ID
|
||||
*/
|
||||
rooms: {[room: string]: {sockets: {[id: string]: boolean }}};
|
||||
rooms: {[room: string]: {sockets: {[id: string]: boolean }, length: number }};
|
||||
|
||||
/**
|
||||
* A dictionary of all the socket ids that we're dealing with, and all
|
||||
|
||||
+15
-2
@@ -1,8 +1,8 @@
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
/// <reference path="sql.js.d.ts" />
|
||||
|
||||
import fs = require("fs");
|
||||
import SQL = require("sql.js");
|
||||
import * as fs from "fs";
|
||||
import * as SQL from "sql.js";
|
||||
|
||||
var DB_PATH = "data.db";
|
||||
|
||||
@@ -34,6 +34,8 @@ db.run(insertRecordStatement, {
|
||||
"@content": "Content 2"
|
||||
});
|
||||
|
||||
var n = db.getRowsModified();
|
||||
|
||||
try {
|
||||
// This query will throw exception: primary key constraint failed.
|
||||
db.run(insertRecordStatement, {
|
||||
@@ -79,3 +81,14 @@ function dbAccessDone(): void {
|
||||
// Finally, close the database connection and release the resources in memory.
|
||||
db.close();
|
||||
}
|
||||
|
||||
// Create a database
|
||||
var db2 = new SQL.Database();
|
||||
|
||||
// You can also use javascript functions inside your SQL code
|
||||
// Create the js function you need
|
||||
function add(a: number, b: number): number {return a+b;}
|
||||
// Specifies the SQL function's name, the number of it's arguments, and the js function to use
|
||||
db2.create_function("add_js", add);
|
||||
// Run a query in which the function is used
|
||||
db2.run("INSERT INTO hello VALUES (add_js(7, 3), add_js('Hello ', 'world'));"); // Inserts 10 and 'Hello world'
|
||||
|
||||
Vendored
+5
@@ -8,6 +8,7 @@
|
||||
declare module "sql.js" {
|
||||
|
||||
class Database {
|
||||
constructor();
|
||||
constructor(data: Buffer);
|
||||
constructor(data: Uint8Array);
|
||||
constructor(data: number[]);
|
||||
@@ -29,6 +30,10 @@ declare module "sql.js" {
|
||||
export(): Uint8Array;
|
||||
|
||||
close(): void;
|
||||
|
||||
getRowsModified(): number;
|
||||
|
||||
create_function(name: string, func: Function): void;
|
||||
}
|
||||
|
||||
class Statement {
|
||||
|
||||
Vendored
+1
-2
@@ -122,8 +122,7 @@ declare class SwiperSlide {
|
||||
}
|
||||
|
||||
declare class Swiper {
|
||||
constructor(container: string, options?: SwiperOptions);
|
||||
constructor(container: Element, options?: SwiperOptions);
|
||||
constructor(container: string|Element, options?: SwiperOptions);
|
||||
|
||||
// Properties
|
||||
width: number;
|
||||
|
||||
Vendored
+66
-55
@@ -1,4 +1,4 @@
|
||||
// Type definitions for three.js r79
|
||||
// Type definitions for three.js r80
|
||||
// Project: http://mrdoob.github.com/three.js/
|
||||
// Definitions by: Kon <http://phyzkit.net/>, Satoru Kimura <https://github.com/gyohk>, Florent Poujol <https://github.com/florentpoujol>, SereznoKot <https://github.com/SereznoKot>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
@@ -149,6 +149,7 @@ declare namespace THREE {
|
||||
export const UnsignedShort4444Type: PixelType;
|
||||
export const UnsignedShort5551Type: PixelType;
|
||||
export const UnsignedShort565Type: PixelType;
|
||||
export const UnsignedInt248Type: PixelType;
|
||||
|
||||
// Pixel formats
|
||||
export enum PixelFormat { }
|
||||
@@ -159,6 +160,7 @@ declare namespace THREE {
|
||||
export const LuminanceAlphaFormat: PixelFormat;
|
||||
export const RGBEFormat: PixelFormat;
|
||||
export const DepthFormat: PixelFormat;
|
||||
export const DepthStencilFormat: PixelFormat;
|
||||
|
||||
// Compressed texture formats
|
||||
// DDS / ST3C Compressed texture formats
|
||||
@@ -246,8 +248,8 @@ declare namespace THREE {
|
||||
getEffectiveWeight(): number;
|
||||
fadeIn(duration: number): AnimationAction;
|
||||
fadeOut(duration: number): AnimationAction;
|
||||
crossFadeFrom(fadeOutAction: AnimationAction,duration: number, warp: boolean): AnimationAction;
|
||||
crossFadeTo(fadeInAction: AnimationAction,duration: number, warp: boolean): AnimationAction;
|
||||
crossFadeFrom(fadeOutAction: AnimationAction, duration: number, warp: boolean): AnimationAction;
|
||||
crossFadeTo(fadeInAction: AnimationAction, duration: number, warp: boolean): AnimationAction;
|
||||
stopFading(): AnimationAction;
|
||||
setEffectiveTimeScale(timeScale: number): AnimationAction;
|
||||
getEffectiveTimeScale(): number;
|
||||
@@ -673,7 +675,7 @@ declare namespace THREE {
|
||||
array: ArrayLike<number>;
|
||||
itemSize: number;
|
||||
dynamic: boolean;
|
||||
updateRange: {offset:number, count:number};
|
||||
updateRange: {offset: number, count: number};
|
||||
version: number;
|
||||
normalized: boolean;
|
||||
needsUpdate: boolean;
|
||||
@@ -684,11 +686,11 @@ declare namespace THREE {
|
||||
copy(source: BufferAttribute): BufferAttribute;
|
||||
copyAt(index1: number, attribute: BufferAttribute, index2: number): BufferAttribute;
|
||||
copyArray(array: ArrayLike<number>): BufferAttribute;
|
||||
copyColorsArray(colors: {r:number, g:number, b:number}[]): BufferAttribute;
|
||||
copyIndicesArray(indices: {a:number, b:number, c:number}[]): BufferAttribute;
|
||||
copyVector2sArray(vectors: {x:number, y:number}[]): BufferAttribute;
|
||||
copyVector3sArray(vectors: {x:number, y:number, z:number}[]): BufferAttribute;
|
||||
copyVector4sArray(vectors: {x:number, y:number, z:number, w:number}[]): BufferAttribute;
|
||||
copyColorsArray(colors: {r: number, g: number, b: number}[]): BufferAttribute;
|
||||
copyIndicesArray(indices: {a: number, b: number, c: number}[]): BufferAttribute;
|
||||
copyVector2sArray(vectors: {x: number, y: number}[]): BufferAttribute;
|
||||
copyVector3sArray(vectors: {x: number, y: number, z: number}[]): BufferAttribute;
|
||||
copyVector4sArray(vectors: {x: number, y: number, z: number, w: number}[]): BufferAttribute;
|
||||
set(value: ArrayLike<number>, offset?: number): BufferAttribute;
|
||||
getX(index: number): number;
|
||||
setX(index: number, x: number): BufferAttribute;
|
||||
@@ -802,8 +804,8 @@ declare namespace THREE {
|
||||
|
||||
center(): Vector3;
|
||||
|
||||
setFromObject(object: Object3D) : void;
|
||||
updateFromObject(object: Object3D) : void;
|
||||
setFromObject(object: Object3D): void;
|
||||
updateFromObject(object: Object3D): void;
|
||||
|
||||
fromGeometry(geometry: Geometry, settings?: any): BufferGeometry;
|
||||
|
||||
@@ -1317,7 +1319,7 @@ declare namespace THREE {
|
||||
dispose(): void;
|
||||
|
||||
|
||||
//These properties do not exist in a normal Geometry class, but if you use the instance that was passed by JSONLoader, it will be added.
|
||||
// These properties do not exist in a normal Geometry class, but if you use the instance that was passed by JSONLoader, it will be added.
|
||||
bones: Bone[];
|
||||
animation: AnimationClip;
|
||||
animations: AnimationClip[];
|
||||
@@ -1339,7 +1341,7 @@ declare namespace THREE {
|
||||
*/
|
||||
export class InstancedBufferAttribute extends BufferAttribute {
|
||||
constructor(data: ArrayLike<number>, itemSize: number, meshPerAttribute?: number);
|
||||
|
||||
|
||||
meshPerAttribute: number;
|
||||
|
||||
clone(): InstancedBufferAttribute;
|
||||
@@ -1352,9 +1354,9 @@ declare namespace THREE {
|
||||
export class InstancedBufferGeometry extends BufferGeometry {
|
||||
constructor();
|
||||
|
||||
groups: {start:number, count:number, instances:number}[];
|
||||
groups: {start: number, count: number, instances: number}[];
|
||||
maxInstancedCount: number;
|
||||
|
||||
|
||||
addGroup(start: number, count: number, instances: number): void;
|
||||
clone(): InstancedBufferGeometry;
|
||||
copy(source: InstancedBufferGeometry): InstancedBufferGeometry;
|
||||
@@ -1388,7 +1390,7 @@ declare namespace THREE {
|
||||
*/
|
||||
export class InstancedInterleavedBuffer extends InterleavedBuffer {
|
||||
constructor(array: ArrayLike<number>, stride: number, meshPerAttribute?: number);
|
||||
|
||||
|
||||
meshPerAttribute: number;
|
||||
|
||||
clone(): InstancedInterleavedBuffer;
|
||||
@@ -1726,9 +1728,9 @@ declare namespace THREE {
|
||||
params: RaycasterParameters;
|
||||
precision: number;
|
||||
linePrecision: number;
|
||||
|
||||
|
||||
set(origin: Vector3, direction: Vector3): void;
|
||||
setFromCamera(coords: { x: number; y: number;}, camera: Camera ): void;
|
||||
setFromCamera(coords: { x: number; y: number; }, camera: Camera ): void;
|
||||
intersectObject(object: Object3D, recursive?: boolean): Intersection[];
|
||||
intersectObjects(objects: Object3D[], recursive?: boolean): Intersection[];
|
||||
}
|
||||
@@ -1792,6 +1794,7 @@ declare namespace THREE {
|
||||
|
||||
copy(source: LightShadow): LightShadow;
|
||||
clone(recursive?: boolean): LightShadow;
|
||||
toJSON(): any;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1988,7 +1991,7 @@ declare namespace THREE {
|
||||
static Handlers: LoaderHandler;
|
||||
}
|
||||
|
||||
export interface LoaderHandler{
|
||||
export interface LoaderHandler {
|
||||
handlers: (RegExp | Loader)[];
|
||||
|
||||
add(regex: RegExp, loader: Loader): void;
|
||||
@@ -2027,6 +2030,7 @@ declare namespace THREE {
|
||||
|
||||
manager: LoadingManager;
|
||||
crossOrigin: string;
|
||||
withCredentials: string;
|
||||
path: string;
|
||||
|
||||
/**
|
||||
@@ -2035,7 +2039,8 @@ declare namespace THREE {
|
||||
*/
|
||||
load(url: string, onLoad?: (image: HTMLImageElement) => void, onProgress?: (event: any) => void, onError?: (event: any) => void): HTMLImageElement;
|
||||
setCrossOrigin(crossOrigin: string): ImageLoader;
|
||||
setPath(value: any): ImageLoader;
|
||||
setWithCredentials(value: string): ImageLoader;
|
||||
setPath(value: string): ImageLoader;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2134,6 +2139,7 @@ declare namespace THREE {
|
||||
|
||||
manager: LoadingManager;
|
||||
crossOrigin: string;
|
||||
withCredentials: string;
|
||||
path: string;
|
||||
|
||||
/**
|
||||
@@ -2143,6 +2149,7 @@ declare namespace THREE {
|
||||
*/
|
||||
load(url: string, onLoad?: (texture: Texture) => void): Texture;
|
||||
setCrossOrigin(crossOrigin: string): TextureLoader;
|
||||
setWithCredentials(value: string): TextureLoader;
|
||||
setPath(path: string): TextureLoader;
|
||||
}
|
||||
|
||||
@@ -2747,7 +2754,7 @@ declare namespace THREE {
|
||||
|
||||
export interface ShaderMaterialParameters extends MaterialParameters {
|
||||
defines?: any;
|
||||
uniforms?: any;
|
||||
uniforms?: any;
|
||||
vertexShader?: string;
|
||||
fragmentShader?: string;
|
||||
lineWidth?: number;
|
||||
@@ -2881,7 +2888,7 @@ declare namespace THREE {
|
||||
applyMatrix4(matrix: Matrix4): Box3;
|
||||
translate(offset: Vector3): Box3;
|
||||
equals(box: Box3): boolean;
|
||||
|
||||
|
||||
empty(): any; // deprecated, use isEmpty()
|
||||
isIntersectionBox(b: any): any; // deprecated, use intersectsBox()
|
||||
isIntersectionSphere(s: any): any; // deprecated, use intersectsSphere()
|
||||
@@ -3169,7 +3176,7 @@ declare namespace THREE {
|
||||
|
||||
export class Euler {
|
||||
constructor(x?: number, y?: number, z?: number, order?: string);
|
||||
|
||||
|
||||
x: number;
|
||||
y: number;
|
||||
z: number;
|
||||
@@ -3180,7 +3187,7 @@ declare namespace THREE {
|
||||
clone(): Euler;
|
||||
copy(euler: Euler): Euler;
|
||||
setFromRotationMatrix(m: Matrix4, order?: string, update?: boolean): Euler;
|
||||
setFromQuaternion(q:Quaternion, order?: string, update?: boolean): Euler;
|
||||
setFromQuaternion(q: Quaternion, order?: string, update?: boolean): Euler;
|
||||
setFromVector3( v: Vector3, order?: string ): Euler;
|
||||
reorder(newOrder: string): Euler;
|
||||
equals(euler: Euler): boolean;
|
||||
@@ -3482,7 +3489,7 @@ declare namespace THREE {
|
||||
* Sets the position component for this matrix from vector v.
|
||||
*/
|
||||
setPosition(v: Vector3): Matrix4;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Sets this matrix to the inverse of matrix m.
|
||||
@@ -3718,7 +3725,7 @@ declare namespace THREE {
|
||||
* Adapted from http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/slerp/.
|
||||
*/
|
||||
static slerp(qa: Quaternion, qb: Quaternion, qm: Quaternion, t: number): Quaternion;
|
||||
|
||||
|
||||
static slerpFlat(dst: number[], dstOffset: number, src0: number[], srcOffset: number, src1: number[], stcOffset1: number, t: number): Quaternion;
|
||||
|
||||
// deprecated
|
||||
@@ -3751,7 +3758,7 @@ declare namespace THREE {
|
||||
intersectTriangle(a: Vector3, b: Vector3, c: Vector3, backfaceCulling: boolean, optionalTarget?: Vector3): Vector3;
|
||||
applyMatrix4(matrix4: Matrix4): Ray;
|
||||
equals(ray: Ray): boolean;
|
||||
|
||||
|
||||
// deprecated
|
||||
isIntersectionBox(b: any): any;
|
||||
isIntersectionPlane(p: any): any;
|
||||
@@ -4348,7 +4355,7 @@ declare namespace THREE {
|
||||
* Sets all values of this vector.
|
||||
*/
|
||||
setScalar(scalar: number): Vector4;
|
||||
|
||||
|
||||
/**
|
||||
* Sets X component of this vector.
|
||||
*/
|
||||
@@ -4501,7 +4508,7 @@ declare namespace THREE {
|
||||
|
||||
interpolate_(i1: number, t0: number, t: number, t1: number): any;
|
||||
}
|
||||
|
||||
|
||||
export class DiscreteInterpolant extends Interpolant {
|
||||
constructor(parameterPositions: any, samplesValues: any, sampleSize: number, resultBuffer?: any);
|
||||
|
||||
@@ -4721,7 +4728,7 @@ declare namespace THREE {
|
||||
domElement: HTMLCanvasElement;
|
||||
|
||||
render(scene: Scene, camera: Camera): void;
|
||||
setSize(width:number, height:number, updateStyle?:boolean): void;
|
||||
setSize(width: number, height: number, updateStyle?: boolean): void;
|
||||
}
|
||||
|
||||
export interface WebGLRendererParameters {
|
||||
@@ -4899,7 +4906,7 @@ declare namespace THREE {
|
||||
getPrecision(): string;
|
||||
getPixelRatio(): number;
|
||||
setPixelRatio(value: number): void;
|
||||
|
||||
|
||||
getSize(): { width: number; height: number; };
|
||||
|
||||
/**
|
||||
@@ -4933,12 +4940,12 @@ declare namespace THREE {
|
||||
setClearColor(color: Color, alpha?: number): void;
|
||||
setClearColor(color: string, alpha?: number): void;
|
||||
setClearColor(color: number, alpha?: number): void;
|
||||
|
||||
|
||||
/**
|
||||
* Returns a float with the current clear alpha. Ranges from 0 to 1.
|
||||
*/
|
||||
getClearAlpha(): number;
|
||||
|
||||
|
||||
setClearAlpha(alpha: number): void;
|
||||
|
||||
/**
|
||||
@@ -4950,7 +4957,7 @@ declare namespace THREE {
|
||||
clearColor(): void;
|
||||
clearDepth(): void;
|
||||
clearStencil(): void;
|
||||
clearTarget(renderTarget:WebGLRenderTarget, color: boolean, depth: boolean, stencil: boolean): void;
|
||||
clearTarget(renderTarget: WebGLRenderTarget, color: boolean, depth: boolean, stencil: boolean): void;
|
||||
resetGLState(): void;
|
||||
dispose(): void;
|
||||
|
||||
@@ -5163,7 +5170,7 @@ declare namespace THREE {
|
||||
uv_pars_vertex: string;
|
||||
uv_vertex: string;
|
||||
worldpos_vertex: string;
|
||||
}
|
||||
};
|
||||
|
||||
export interface Shader {
|
||||
uniforms: IUniform;
|
||||
@@ -5307,7 +5314,7 @@ declare namespace THREE {
|
||||
export function clone(uniforms_src: any): any;
|
||||
}
|
||||
|
||||
export class Uniform {
|
||||
export class Uniform {
|
||||
constructor(value: any);
|
||||
constructor(type: string, value: any); // deprecated
|
||||
|
||||
@@ -5335,7 +5342,7 @@ declare namespace THREE {
|
||||
init(planes: any[], enableLocalClipping: boolean, camera: Camera): boolean;
|
||||
beginShadows(): void;
|
||||
endShadows(): void;
|
||||
setState(planes: any[], clipShadows: boolean, camera: Camera, cache: boolean, fromCache: boolean): void;
|
||||
setState(planes: any[], clipShadows: boolean, camera: Camera, cache: boolean, fromCache: boolean): void;
|
||||
}
|
||||
|
||||
export interface WebGLCapabilitiesParameters {
|
||||
@@ -5378,7 +5385,7 @@ declare namespace THREE {
|
||||
|
||||
export class WebGLLights {
|
||||
constructor(gl: WebGLRenderingContext, properties: any, info: any);
|
||||
|
||||
|
||||
get(light: any): any;
|
||||
}
|
||||
|
||||
@@ -5390,7 +5397,7 @@ declare namespace THREE {
|
||||
render(start: any, count: number): void;
|
||||
renderInstances(geometry: any, start: any, count: number): void;
|
||||
}
|
||||
|
||||
|
||||
export class WebGLObjects {
|
||||
constructor(gl: WebGLRenderingContext, properties: any, info: any);
|
||||
|
||||
@@ -5401,7 +5408,7 @@ declare namespace THREE {
|
||||
|
||||
export class WebGLProgram {
|
||||
constructor(renderer: WebGLRenderer, code: string, material: ShaderMaterial, parameters: WebGLRendererParameters);
|
||||
|
||||
|
||||
id: number;
|
||||
code: string;
|
||||
usedTimes: number;
|
||||
@@ -5428,7 +5435,7 @@ declare namespace THREE {
|
||||
}
|
||||
|
||||
export class WebGLTextures {
|
||||
constructor(gl: any, extensions: any, state: any, properties:any, capabilities: any, paramThreeToGL: Function, info: any);
|
||||
constructor(gl: any, extensions: any, state: any, properties: any, capabilities: any, paramThreeToGL: Function, info: any);
|
||||
|
||||
setTexture2D(texture: any, slot: number): void;
|
||||
setTextureCube(texture: any, slot: number): void;
|
||||
@@ -5451,7 +5458,7 @@ declare namespace THREE {
|
||||
static splitDynamic(seq: any, values: any[]): any[];
|
||||
static evalDynamic(seq: any, values: any[], object: any, camera: any): any[];
|
||||
}
|
||||
|
||||
|
||||
export class WebGLProperties {
|
||||
constructor();
|
||||
|
||||
@@ -5479,7 +5486,7 @@ declare namespace THREE {
|
||||
// deprecated
|
||||
cullFace: any;
|
||||
}
|
||||
|
||||
|
||||
export class WebGLState {
|
||||
constructor(gl: any, extensions: any, paramThreeToGL: Function);
|
||||
|
||||
@@ -5559,7 +5566,7 @@ declare namespace THREE {
|
||||
// Renderers / WebGL / Plugins /////////////////////////////////////////////////////////////////////
|
||||
export class LensFlarePlugin {
|
||||
constructor(renderer: WebGLRenderer, flares: any[]);
|
||||
|
||||
|
||||
render(scene: Scene, camera: Camera, viewportWidth: number, viewportHeight: number): void;
|
||||
}
|
||||
|
||||
@@ -5570,7 +5577,7 @@ declare namespace THREE {
|
||||
}
|
||||
|
||||
// Scenes /////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
/**
|
||||
* Scenes allow you to set up what and where is to be rendered by three.js. This is where you place objects, lights and cameras.
|
||||
*/
|
||||
@@ -5590,12 +5597,14 @@ declare namespace THREE {
|
||||
background: any;
|
||||
|
||||
copy(source: Scene, recursive?: boolean): Scene;
|
||||
toJSON(meta?: any): any;
|
||||
}
|
||||
|
||||
export interface IFog {
|
||||
name:string;
|
||||
name: string;
|
||||
color: Color;
|
||||
clone():IFog;
|
||||
clone(): IFog;
|
||||
toJSON(): any;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -5604,7 +5613,7 @@ declare namespace THREE {
|
||||
export class Fog implements IFog {
|
||||
constructor(hex: number, near?: number, far?: number);
|
||||
|
||||
name:string;
|
||||
name: string;
|
||||
|
||||
/**
|
||||
* Fog color.
|
||||
@@ -5623,6 +5632,7 @@ declare namespace THREE {
|
||||
far: number;
|
||||
|
||||
clone(): Fog;
|
||||
toJSON(): any;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -5641,6 +5651,7 @@ declare namespace THREE {
|
||||
density: number;
|
||||
|
||||
clone(): FogExp2;
|
||||
toJSON(): any;
|
||||
}
|
||||
|
||||
// Textures /////////////////////////////////////////////////////////////////////
|
||||
@@ -5949,7 +5960,7 @@ declare namespace THREE {
|
||||
* Returns a vector for point at relative position in curve according to arc length
|
||||
* getPointAt(u: number): T;
|
||||
*/
|
||||
getPointAt(u: number):T;
|
||||
getPointAt(u: number): T;
|
||||
|
||||
/**
|
||||
* Get sequence of points using getPoint( t )
|
||||
@@ -6096,7 +6107,7 @@ declare namespace THREE {
|
||||
|
||||
export class ClosedSplineCurve3 extends CatmullRomCurve3 {} // deprecated, use CatmullRomCurve3
|
||||
export class SplineCurve3 extends CatmullRomCurve3 {} // will be deprecated, use CatmullRomCurve3
|
||||
|
||||
|
||||
export class CubicBezierCurve extends Curve<Vector2> {
|
||||
constructor(v0: Vector2, v1: Vector2, v2: Vector2, v3: Vector2);
|
||||
|
||||
@@ -6116,7 +6127,7 @@ declare namespace THREE {
|
||||
|
||||
getPoint(t: number): Vector3;
|
||||
}
|
||||
|
||||
|
||||
export class EllipseCurve extends Curve<Vector2> {
|
||||
constructor(aX: number, aY: number, xRadius: number, yRadius: number, aStartAngle: number, aEndAngle: number, aClockwise: boolean, aRotation: number);
|
||||
|
||||
@@ -6148,7 +6159,7 @@ declare namespace THREE {
|
||||
|
||||
getPoint(t: number): Vector3;
|
||||
}
|
||||
|
||||
|
||||
export class QuadraticBezierCurve extends Curve<Vector2> {
|
||||
constructor( v0: Vector2, v1: Vector2, v2: Vector2 );
|
||||
|
||||
@@ -6172,7 +6183,7 @@ declare namespace THREE {
|
||||
|
||||
points: Vector2[];
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Extras / Geometries /////////////////////////////////////////////////////////////////////
|
||||
export class BoxBufferGeometry extends BufferGeometry {
|
||||
@@ -6487,7 +6498,7 @@ declare namespace THREE {
|
||||
bevelEnabled: boolean;
|
||||
bevelThickness: number;
|
||||
bevelSize: number;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export class TorusBufferGeometry extends BufferGeometry {
|
||||
@@ -6735,6 +6746,6 @@ declare namespace THREE {
|
||||
}
|
||||
}
|
||||
|
||||
declare module 'three' {
|
||||
declare module "three" {
|
||||
export = THREE;
|
||||
}
|
||||
|
||||
Vendored
+5
-5
@@ -5074,7 +5074,7 @@ interface _Chain<T> {
|
||||
* Wrapped type `any[]`.
|
||||
* @see _.all
|
||||
**/
|
||||
all(iterator?: _.ListIterator<T, boolean>, context?: any): _Chain<T>;
|
||||
all(iterator?: _.ListIterator<T, boolean>, context?: any): _ChainSingle<boolean>;
|
||||
|
||||
/**
|
||||
* @see _.all
|
||||
@@ -5390,18 +5390,18 @@ interface _Chain<T> {
|
||||
* Wrapped type `any[]`.
|
||||
* @see _.indexOf
|
||||
**/
|
||||
indexOf(value: T, isSorted?: boolean): _ChainSingle<T>;
|
||||
indexOf(value: T, isSorted?: boolean): _ChainSingle<number>;
|
||||
|
||||
/**
|
||||
* @see _.indexOf
|
||||
**/
|
||||
indexOf(value: T, startFrom: number): _ChainSingle<T>;
|
||||
indexOf(value: T, startFrom: number): _ChainSingle<number>;
|
||||
|
||||
/**
|
||||
* Wrapped type `any[]`.
|
||||
* @see _.lastIndexOf
|
||||
**/
|
||||
lastIndexOf(value: T, from?: number): _ChainSingle<T>;
|
||||
lastIndexOf(value: T, from?: number): _ChainSingle<number>;
|
||||
|
||||
/**
|
||||
* @see _.findIndex
|
||||
@@ -5417,7 +5417,7 @@ interface _Chain<T> {
|
||||
* Wrapped type `any[]`.
|
||||
* @see _.sortedIndex
|
||||
**/
|
||||
sortedIndex(value: T, iterator?: (x: T) => any, context?: any): _Chain<T>;
|
||||
sortedIndex(value: T, iterator?: (x: T) => any, context?: any): _ChainSingle<number>;
|
||||
|
||||
/**
|
||||
* Wrapped type `number`.
|
||||
|
||||
Reference in New Issue
Block a user