mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 14:57:10 +00:00
+393
-175
File diff suppressed because it is too large
Load Diff
@@ -46,6 +46,7 @@ npm-debug.log
|
||||
.settings/launch.json
|
||||
.vs
|
||||
.vscode
|
||||
.history
|
||||
|
||||
# yarn
|
||||
yarn.lock
|
||||
|
||||
@@ -336,3 +336,6 @@ This project is licensed under the MIT license.
|
||||
Copyrights on the definition files are respective of each contributor listed at the beginning of each definition file.
|
||||
|
||||
[](https://github.com/igrigorik/ga-beacon)
|
||||
|
||||
[](https://typescript.visualstudio.com/TypeScript/_build/latest?definitionId=13) Are packages being published to npm in less than 10,000 seconds on average?
|
||||
[](https://typescript.visualstudio.com/TypeScript/_build/latest?definitionId=14) Has typescript-bot been active on DefinitelyTyped in the last two hours?
|
||||
|
||||
@@ -144,6 +144,12 @@
|
||||
"sourceRepoURL": "https://github.com/Azure/azure-mobile-apps-node/",
|
||||
"asOfVersion": "3.0.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "@babel/parser",
|
||||
"typingsPackageName": "babel__parser",
|
||||
"sourceRepoURL": "https://github.com/babel/babel",
|
||||
"asOfVersion": "7.1.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "BabylonJS",
|
||||
"typingsPackageName": "babylonjs",
|
||||
@@ -540,6 +546,12 @@
|
||||
"sourceRepoURL": "https://github.com/code-chris/extended-listbox",
|
||||
"asOfVersion": "4.0.1"
|
||||
},
|
||||
{
|
||||
"libraryName": "fast-diff",
|
||||
"typingsPackageName": "fast-diff",
|
||||
"sourceRepoURL": "https://github.com/jhchen/fast-diff",
|
||||
"asOfVersion": "1.2.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "JSON-Patch",
|
||||
"typingsPackageName": "fast-json-patch",
|
||||
@@ -624,6 +636,12 @@
|
||||
"sourceRepoURL": "https://github.com/mikedeboer/node-github",
|
||||
"asOfVersion": "7.1.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "gitlab",
|
||||
"typingsPackageName": "gitlab",
|
||||
"sourceRepoURL": "https://github.com/jdalrymple/node-gitlab",
|
||||
"asOfVersion": "2.0.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "graphene-pk11",
|
||||
"typingsPackageName": "graphene-pk11",
|
||||
@@ -942,6 +960,12 @@
|
||||
"sourceRepoURL": "http://maquettejs.org/",
|
||||
"asOfVersion": "2.1.6"
|
||||
},
|
||||
{
|
||||
"libraryName": "maxmind",
|
||||
"typingsPackageName": "maxmind",
|
||||
"sourceRepoURL": "https://github.com/runk/node-maxmind",
|
||||
"asOfVersion": "2.0.5"
|
||||
},
|
||||
{
|
||||
"libraryName": "mendixmodelsdk",
|
||||
"typingsPackageName": "mendixmodelsdk",
|
||||
@@ -978,6 +1002,12 @@
|
||||
"sourceRepoURL": "https://github.com/mweststrate/mobservable-react",
|
||||
"asOfVersion": "1.0.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "Mobx Cookie",
|
||||
"typingsPackageName": "mobx-cookie",
|
||||
"sourceRepoURL": "https://github.com/will-stone/mobx-cookie",
|
||||
"asOfVersion": "1.1.1"
|
||||
},
|
||||
{
|
||||
"libraryName": "Moment",
|
||||
"typingsPackageName": "moment",
|
||||
@@ -1626,6 +1656,12 @@
|
||||
"sourceRepoURL": "https://github.com/ansman/validate.js",
|
||||
"asOfVersion": "0.11.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "vega",
|
||||
"typingsPackageName": "vega",
|
||||
"sourceRepoURL": "https://github.com/vega/vega",
|
||||
"asOfVersion": "3.2.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "vso-node-api",
|
||||
"typingsPackageName": "vso-node-api",
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
import * as accept from 'accept';
|
||||
|
||||
accept.charsets("iso-8859-5, unicode-1-1;q=0.8"); // charset === "iso-8859-5"
|
||||
accept.charset("iso-8859-5, unicode-1-1;q=0.8", ["unicode-1-1"]); // charset === "unicode-1-1"
|
||||
|
||||
accept.encoding("gzip, deflate, sdch"); // encoding === "gzip"
|
||||
accept.encoding("gzip, deflate, sdch", ["deflate", "identity"]);
|
||||
|
||||
const encodings = accept.encodings("compress;q=0.5, gzip;q=1.0"); // encodings === ["gzip", "compress", "identity"]
|
||||
encodings.lastIndexOf('');
|
||||
|
||||
accept.language("en;q=0.7, en-GB;q=0.8");
|
||||
accept.language("en;q=0.7, en-GB;q=0.8", ["en-gb"]); // language === "en-GB"
|
||||
const languages = accept.languages("da, en;q=0.7, en-GB;q=0.8"); // languages === ["da", "en-GB", "en"]
|
||||
languages.lastIndexOf('');
|
||||
|
||||
const mediaTypes = accept.mediaTypes("text/plain, application/json;q=0.5, text/html, */*;q=0.1");
|
||||
// mediaTypes === ["text/plain", "text/html", "application/json", "*/*"]
|
||||
mediaTypes.lastIndexOf('');
|
||||
const headers = {
|
||||
accept: 'text/plain, application/json;q=0.5, text/html, */*;q=0.1',
|
||||
'accept-language': 'da, en;q=0.7, en-GB;q=0.8'
|
||||
};
|
||||
|
||||
const all = accept.parseAll(headers);
|
||||
all.charsets.length;
|
||||
all.encodings.length;
|
||||
all.languages.length;
|
||||
all.mediaTypes.length;
|
||||
Vendored
+21
@@ -0,0 +1,21 @@
|
||||
// Type definitions for accept 3.1
|
||||
// Project: https://github.com/hapijs/accept#readme
|
||||
// Definitions by: feinoujc <https://github.com/feinoujc>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.1
|
||||
|
||||
export function charset(charsetHeader?: string, preferences?: string[]): string;
|
||||
export function charsets(charsetHeader?: string): string[];
|
||||
export function encoding(encodingHeader?: string, preferences?: string[]): string;
|
||||
export function encodings(encodingHeader?: string): string[];
|
||||
export function language(languageHeader?: string, preferences?: string[]): string;
|
||||
export function languages(languageHeader?: string): string[];
|
||||
export function mediaTypes(mediaTypeHeader?: string): string[];
|
||||
export function parseAll(
|
||||
headers: Record<string, string | string[] | undefined>
|
||||
): {
|
||||
charsets: string[];
|
||||
encodings: string[];
|
||||
languages: string[];
|
||||
mediaTypes: string[];
|
||||
};
|
||||
@@ -18,6 +18,6 @@
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"gitlab-tests.ts"
|
||||
"accept-tests.ts"
|
||||
]
|
||||
}
|
||||
Vendored
+2
-2
@@ -64,7 +64,7 @@ declare class Agenda extends EventEmitter {
|
||||
defaultConcurrency(value: number): this;
|
||||
|
||||
/**
|
||||
* Takes a number shich specifies the max number jobs that can be locked at any given moment. By default it is
|
||||
* Takes a number which specifies the max number jobs that can be locked at any given moment. By default it is
|
||||
* 0 for no max.
|
||||
* @param value The value to set.
|
||||
*/
|
||||
@@ -189,7 +189,7 @@ declare namespace Agenda {
|
||||
defaultLockLimit?: number;
|
||||
|
||||
/**
|
||||
* Takes a number shich specifies the max number jobs that can be locked at any given moment. By default it is
|
||||
* Takes a number which specifies the max number jobs that can be locked at any given moment. By default it is
|
||||
* 0 for no max.
|
||||
*/
|
||||
lockLimit?: number;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Vendored
+3265
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"esnext",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"esModuleInterop": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"ali-app-tests.ts"
|
||||
],
|
||||
"exclude": [
|
||||
".prettierrc"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"no-mergeable-namespace": false,
|
||||
"no-unnecessary-generics": false
|
||||
}
|
||||
}
|
||||
Vendored
-63
@@ -1,63 +0,0 @@
|
||||
import {
|
||||
ACLType,
|
||||
CopyAndPutMetaResult,
|
||||
CopyObjectOptions,
|
||||
DeleteMultiOptions,
|
||||
DeleteMultiResult,
|
||||
GetObjectOptions,
|
||||
GetObjectResult,
|
||||
GetStreamOptions,
|
||||
GetStreamResult,
|
||||
HeadObjectOptions,
|
||||
HeadObjectResult,
|
||||
ListObjectResult,
|
||||
ListObjectsQuery,
|
||||
NormalSuccessResponse,
|
||||
PutObjectOptions,
|
||||
PutObjectResult,
|
||||
PutStreamOptions,
|
||||
RequestOptions,
|
||||
SignatureUrlOptions,
|
||||
UserMeta
|
||||
} from "./index";
|
||||
|
||||
export interface ClusterType {
|
||||
host: string;
|
||||
accessKeyId: string;
|
||||
accessKeySecret: string;
|
||||
}
|
||||
|
||||
export interface ClusterOptions {
|
||||
clusters: ClusterType[];
|
||||
schedule?: string;
|
||||
}
|
||||
|
||||
export class Cluster {
|
||||
constructor(options: ClusterOptions)
|
||||
|
||||
list(query: ListObjectsQuery | null, options: RequestOptions): Promise<ListObjectResult>;
|
||||
|
||||
put(name: string, file: any, options?: PutObjectOptions): Promise<PutObjectResult>;
|
||||
|
||||
putStream(name: string, stream: any, options?: PutStreamOptions): Promise<{ name: string, res: NormalSuccessResponse }>;
|
||||
|
||||
head(name: string, options?: HeadObjectOptions): Promise<HeadObjectResult>;
|
||||
|
||||
get(name: string, file?: any, options?: GetObjectOptions): Promise<GetObjectResult>;
|
||||
|
||||
getStream(name?: string, options?: GetStreamOptions): Promise<GetStreamResult>;
|
||||
|
||||
delete(name: string, options?: RequestOptions): Promise<NormalSuccessResponse>;
|
||||
|
||||
copy(name: string, sourceName: string, options?: CopyObjectOptions): Promise<CopyAndPutMetaResult>;
|
||||
|
||||
putMeta(name: string, meta: UserMeta, options: RequestOptions): Promise<CopyAndPutMetaResult>;
|
||||
|
||||
deleteMulti(names: string[], options?: DeleteMultiOptions): Promise<DeleteMultiResult>;
|
||||
|
||||
signatureUrl(name: string, options?: SignatureUrlOptions): string;
|
||||
|
||||
putACL(name: string, acl: ACLType, options?: RequestOptions): Promise<NormalSuccessResponse>;
|
||||
|
||||
restore(name: string, options?: RequestOptions): Promise<NormalSuccessResponse>;
|
||||
}
|
||||
Vendored
-71
@@ -1,71 +0,0 @@
|
||||
import { NormalSuccessResponse, RequestOptions } from "./index";
|
||||
|
||||
export interface ImageClientOptions {
|
||||
imageHost: string; // your image service domain that binding to a OSS bucket
|
||||
accessKeyId: string; // access key you create on aliyun console website
|
||||
accessKeySecret: string; // access secret you create
|
||||
bucket: string; // the default bucket you want to access If you don't have any bucket, please use putBucket() create one first.
|
||||
region?: string; // the bucket data region location, please see Data Regions, default is oss-cn-hangzhou
|
||||
internal?: boolean; // access OSS with aliyun internal network or not, default is false If your servers are running on aliyun too, you can set true to save lot of money.
|
||||
timeout?: string | number; // instance level timeout for all operations, default is 60s
|
||||
}
|
||||
|
||||
export interface ImageGetOptions {
|
||||
timeout?: number;
|
||||
headers?: object;
|
||||
}
|
||||
|
||||
export interface StyleData {
|
||||
Name: string; // style name
|
||||
Content: string; // style content
|
||||
CreateTime: string; // style create time
|
||||
LastModifyTime: string; // style last modify time
|
||||
}
|
||||
export class ImageClient {
|
||||
constructor(options: ImageClientOptions)
|
||||
|
||||
/**
|
||||
* Get an image from the image channel.
|
||||
*/
|
||||
get(name: string, file?: any, options?: ImageGetOptions): Promise<{ content: any, res: NormalSuccessResponse }>;
|
||||
|
||||
/**
|
||||
* Get an image read stream.
|
||||
*/
|
||||
getStream(name: string, options?: ImageGetOptions): Promise<{ stream: any, res: NormalSuccessResponse }>;
|
||||
|
||||
/**
|
||||
* Get a image exif info by image object name from the image channel.
|
||||
*/
|
||||
getExif(name: string, options?: RequestOptions): Promise<{ data: object, res: NormalSuccessResponse }>;
|
||||
|
||||
/**
|
||||
* Get a image info and exif info by image object name from the image channel.
|
||||
*/
|
||||
getInfo(name: string, options?: RequestOptions): Promise<{ data: object, res: NormalSuccessResponse }>;
|
||||
|
||||
/**
|
||||
* todo
|
||||
*/
|
||||
putStyle(name: string, style: string, options?: RequestOptions): Promise<{ data: object, res: NormalSuccessResponse }>;
|
||||
|
||||
/**
|
||||
* Get a style by name from the image channel.
|
||||
*/
|
||||
getStyle(name: string, options?: RequestOptions): Promise<{ data: StyleData, res: NormalSuccessResponse}>;
|
||||
|
||||
/**
|
||||
* Get all styles from the image channel.
|
||||
*/
|
||||
listStyle(options?: RequestOptions): Promise<StyleData[]>;
|
||||
|
||||
/**
|
||||
* todo
|
||||
*/
|
||||
deleteStyle(styleName: string, options?: RequestOptions): Promise<NormalSuccessResponse>;
|
||||
|
||||
/**
|
||||
* Create a signature url for directly download.
|
||||
*/
|
||||
signatureUrl(name: string, options?: { expires?: string, timeout?: string }): string;
|
||||
}
|
||||
@@ -1,34 +1,25 @@
|
||||
import OSS from "ali-oss";
|
||||
import * as OSS from 'ali-oss';
|
||||
|
||||
const client = new OSS({
|
||||
const ossOptions: OSS.Options = {
|
||||
accessKeyId: 'your access key',
|
||||
accessKeySecret: 'your access secret',
|
||||
bucket: 'your bucket name',
|
||||
region: 'oss-cn-hangzhou'
|
||||
});
|
||||
};
|
||||
|
||||
const ImageClient = OSS.ImageClient({
|
||||
imageHost: 'host',
|
||||
accessKeySecret: "secret",
|
||||
accessKeyId: 'id',
|
||||
bucket: "",
|
||||
internal: false,
|
||||
region: "",
|
||||
timeout: 2000
|
||||
});
|
||||
const client = new OSS(ossOptions);
|
||||
|
||||
const cluster = OSS.Cluster({
|
||||
clusters: [
|
||||
{
|
||||
accessKeyId: 'id',
|
||||
accessKeySecret: 'secret',
|
||||
host: ""
|
||||
},
|
||||
{
|
||||
accessKeyId: 'id',
|
||||
accessKeySecret: 'secret',
|
||||
host: ""
|
||||
},
|
||||
],
|
||||
schedule: 'masterSlave',
|
||||
});
|
||||
const clusterOptions: OSS.ClusterOptions = {
|
||||
clusters: [],
|
||||
};
|
||||
|
||||
const clusterClient = new OSS.Cluster(clusterOptions);
|
||||
|
||||
const imageOptions: OSS.ImageClientOptions = {
|
||||
imageHost: 'xxxx',
|
||||
accessKeyId: 'xxxx',
|
||||
accessKeySecret: 'xxxx',
|
||||
bucket: 'xxxx'
|
||||
};
|
||||
|
||||
const imageClient = new OSS.ImageClient(imageOptions);
|
||||
|
||||
Vendored
+576
-463
File diff suppressed because it is too large
Load Diff
@@ -18,8 +18,6 @@
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"ImageClient.d.ts",
|
||||
"Cluster.d.ts",
|
||||
"ali-oss-tests.ts"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"no-mergeable-namespace": false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
"max-line-length": false,
|
||||
"member-access": false,
|
||||
"new-parens": false,
|
||||
"no-angle-bracket-type-assertion": false,
|
||||
"no-any-union": false,
|
||||
"no-boolean-literal-compare": false,
|
||||
"no-conditional-assignment": false,
|
||||
|
||||
Vendored
+12
-8
@@ -22,8 +22,8 @@ declare namespace AnalyticsNode {
|
||||
},
|
||||
timestamp?: Date;
|
||||
messageId?: string;
|
||||
anonymousId: string | number;
|
||||
userId: string | number;
|
||||
anonymousId?: string | number;
|
||||
userId?: string | number;
|
||||
}
|
||||
|
||||
interface Data {
|
||||
@@ -47,7 +47,8 @@ declare namespace AnalyticsNode {
|
||||
/* The identify method lets you tie a user to their actions and record
|
||||
traits about them. */
|
||||
identify(message: {
|
||||
userId: string | number;
|
||||
userId?: string | number;
|
||||
anonymousId?: string | number;
|
||||
traits?: Object;
|
||||
timestamp?: Date;
|
||||
context?: Object;
|
||||
@@ -56,7 +57,8 @@ declare namespace AnalyticsNode {
|
||||
|
||||
/* The track method lets you record the actions your users perform. */
|
||||
track(message: {
|
||||
userId: string | number;
|
||||
userId?: string | number;
|
||||
anonymousId?: string | number;
|
||||
event: string;
|
||||
properties?: Object;
|
||||
timestamp?: Date;
|
||||
@@ -67,7 +69,8 @@ declare namespace AnalyticsNode {
|
||||
/* The page method lets you record page views on your website, along with
|
||||
optional extra information about the page being viewed. */
|
||||
page(message: {
|
||||
userId: string | number;
|
||||
userId?: string | number;
|
||||
anonymousId?: string | number;
|
||||
category?: string;
|
||||
name?: string;
|
||||
properties?: Object;
|
||||
@@ -79,19 +82,20 @@ declare namespace AnalyticsNode {
|
||||
/* alias is how you associate one identity with another. */
|
||||
alias(message: {
|
||||
previousId: string | number;
|
||||
userId: string | number;
|
||||
userId?: string | number;
|
||||
anonymousId?: string | number;
|
||||
integrations?: Integrations;
|
||||
}, callback?: (err: Error, data: Data) => void): Analytics;
|
||||
|
||||
/* Group calls can be used to associate individual users with shared
|
||||
accounts or companies. */
|
||||
group(message: {
|
||||
userId: string | number;
|
||||
userId?: string | number;
|
||||
anonymousId?: string | number;
|
||||
groupId: string | number;
|
||||
traits?: Object;
|
||||
context?: Object;
|
||||
timestamp?: Date;
|
||||
anonymous_id?: string | number;
|
||||
integrations?: Integrations;
|
||||
}, callback?: (err: Error, data: Data) => void): Analytics;
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
"max-line-length": false,
|
||||
"member-access": false,
|
||||
"new-parens": false,
|
||||
"no-angle-bracket-type-assertion": false,
|
||||
"no-any-union": false,
|
||||
"no-boolean-literal-compare": false,
|
||||
"no-conditional-assignment": false,
|
||||
|
||||
Vendored
+1
@@ -76,6 +76,7 @@ declare module 'angular' {
|
||||
|
||||
interface IConfirmDialog extends IPresetDialog<IConfirmDialog> {
|
||||
cancel(cancel: string): IConfirmDialog;
|
||||
multiple(multiple: boolean): IConfirmDialog;
|
||||
}
|
||||
|
||||
interface IPromptDialog extends IPresetDialog<IPromptDialog> {
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
"max-line-length": false,
|
||||
"member-access": false,
|
||||
"new-parens": false,
|
||||
"no-angle-bracket-type-assertion": false,
|
||||
"no-any-union": false,
|
||||
"no-boolean-literal-compare": false,
|
||||
"no-conditional-assignment": false,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
angular.module('promise-tracker-tests', []).run(['$q', 'promiseTracker',
|
||||
($q: angular.IQService, promiseTracker: angular.promisetracker.PromiseTrackerService) => {
|
||||
angular.module('promise-tracker-tests', []).run(['$q', '$http', 'promiseTracker',
|
||||
($q: angular.IQService, $http: angular.IHttpService, promiseTracker: angular.promisetracker.PromiseTrackerService) => {
|
||||
const trackerWithoutOptions = promiseTracker();
|
||||
|
||||
const options = {
|
||||
@@ -19,4 +19,8 @@ angular.module('promise-tracker-tests', []).run(['$q', 'promiseTracker',
|
||||
const addedPromise: angular.IDeferred<void> = trackerWithOptions.addPromise(promiseToAdd);
|
||||
|
||||
const trackerWithSomeOptions = promiseTracker({activationDelay: 500});
|
||||
|
||||
$http.post('/foo', {}, { });
|
||||
$http.post('/foo', {}, { tracker: trackerWithOptions });
|
||||
$http.post('/foo', {}, { tracker: [trackerWithoutOptions, trackerWithOptions] });
|
||||
}]);
|
||||
|
||||
+4
@@ -28,4 +28,8 @@ declare module 'angular' {
|
||||
(options?: PromiseTrackerOptions): PromiseTracker;
|
||||
}
|
||||
}
|
||||
|
||||
interface IRequestShortcutConfig {
|
||||
tracker?: angular.promisetracker.PromiseTracker | angular.promisetracker.PromiseTracker[];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,10 @@ angular
|
||||
closeButton: false,
|
||||
closeHtml: '<button>×</button>',
|
||||
extendedTimeOut: 1000,
|
||||
extraData: {
|
||||
txt: "sample text",
|
||||
action: () => {/* Do action */},
|
||||
},
|
||||
iconClasses: {
|
||||
error: 'toast-error',
|
||||
info: 'toast-info',
|
||||
@@ -29,7 +33,6 @@ angular
|
||||
progressBar: false,
|
||||
tapToDismiss: true,
|
||||
templates: {
|
||||
|
||||
toast: 'directives/toast/toast.html',
|
||||
progressbar: 'directives/progressbar/progressbar.html'
|
||||
},
|
||||
|
||||
Vendored
+1
@@ -24,6 +24,7 @@ declare module 'angular' {
|
||||
closeButton?: boolean;
|
||||
closeHtml?: string;
|
||||
extendedTimeOut?: number;
|
||||
extraData?: any,
|
||||
messageClass?: string;
|
||||
onHidden?: (wasClicked: boolean, toast: angular.toastr.IToast) => void;
|
||||
onShown?: (toast: angular.toastr.IToast) => void;
|
||||
|
||||
Vendored
+1
-1
@@ -2,7 +2,7 @@
|
||||
// Project: https://github.com/mgonto/angular-wizard
|
||||
// Definitions by: Marko Jurisic <https://github.com/mjurisic>, Ronald Wildenberg <https://github.com/rwwilden>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
import * as angular from 'angular';
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
"max-line-length": false,
|
||||
"member-access": false,
|
||||
"new-parens": false,
|
||||
"no-angle-bracket-type-assertion": false,
|
||||
"no-any-union": false,
|
||||
"no-boolean-literal-compare": false,
|
||||
"no-conditional-assignment": false,
|
||||
|
||||
@@ -20,5 +20,13 @@ Object.keys({
|
||||
, brightCyan: 96
|
||||
, brightWhite: 97
|
||||
}).forEach((color) => {
|
||||
cursor[color]().bold().write(`Hello, bold ${color.replace(/([a-z])([A-Z])/g, (_: string, l: string, u: string): string => `${l} ${u.toLowerCase()}`)} world!\n`).reset();
|
||||
const cname = color.replace(/([a-z])([A-Z])/g, (_: string, l: string, u: string): string => `${l} ${u.toLowerCase()}`);
|
||||
|
||||
((cursor[color] as (...anything: any[]) => ansi.Cursor)()
|
||||
.bold()
|
||||
.bg)[color === 'blue' || color === 'brightBlue' ? 'black' : 'blue']()
|
||||
.write(
|
||||
`Hello, bold ${cname} world!\n`
|
||||
)
|
||||
.reset();
|
||||
});
|
||||
|
||||
Vendored
+16
-3
@@ -2,6 +2,7 @@
|
||||
// Project: https://www.npmjs.com/package/ansi
|
||||
// Definitions by: Gustavo6046 <https://github.com/Gustavo6046>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.1
|
||||
|
||||
/**
|
||||
* References:
|
||||
@@ -14,11 +15,19 @@
|
||||
/// <reference types="node" />
|
||||
import { Stream } from "stream";
|
||||
|
||||
declare function ansi(stream: Stream, options?: any): ansi.Cursor;
|
||||
interface CursorOptions {
|
||||
enabled: boolean;
|
||||
buffering: boolean;
|
||||
}
|
||||
|
||||
declare function ansi(stream: Stream, options?: CursorOptions): ansi.Cursor;
|
||||
|
||||
declare namespace ansi {
|
||||
class Cursor {
|
||||
constructor(stream: Stream, options?: any);
|
||||
bg: Colorer;
|
||||
fg: Colorer;
|
||||
|
||||
constructor(stream: Stream, options?: CursorOptions);
|
||||
|
||||
/**
|
||||
* Helper function that calls `write()` on the underlying Stream.
|
||||
@@ -161,7 +170,11 @@ declare namespace ansi {
|
||||
}
|
||||
|
||||
interface Cursor {
|
||||
[key: string]: (...anything: any[]) => Cursor;
|
||||
[key: string]: ((...anything: any[]) => Cursor) | Colorer;
|
||||
}
|
||||
|
||||
interface Colorer {
|
||||
[key: string]: (...anything: any[]) => (Cursor | Colorer);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Vendored
+41
-4
@@ -1,8 +1,45 @@
|
||||
// Type definitions for ansicolors
|
||||
// Project: https://github.com/thlorenz/ansicolors
|
||||
// Definitions by: rogierschouten <https://github.com/rogierschouten>
|
||||
// Definitions by: Benjamin Arthur Lupton <https://github.com/balupton>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
|
||||
declare var colors: { [index: string]: (s: string) => string; };
|
||||
export = colors;
|
||||
interface Colors extends String {
|
||||
(value: string): string
|
||||
white: this
|
||||
black: this
|
||||
blue: this
|
||||
cyan: this
|
||||
green: this
|
||||
magenta: this
|
||||
red: this
|
||||
yellow: this
|
||||
brightBlack: this
|
||||
brightRed: this
|
||||
brightGreen: this
|
||||
brightYellow: this
|
||||
brightBlue: this
|
||||
brightMagenta: this
|
||||
brightCyan: this
|
||||
brightWhite: this
|
||||
bgBlack: this
|
||||
bgRed: this
|
||||
bgGreen: this
|
||||
bgYellow: this
|
||||
bgBlue: this
|
||||
bgMagenta: this
|
||||
bgCyan: this
|
||||
bgWhite: this
|
||||
bgBrightBlack: this
|
||||
bgBrightRed: this
|
||||
bgBrightGreen: this
|
||||
bgBrightYellow: this
|
||||
bgBrightBlue: this
|
||||
bgBrightMagenta: this
|
||||
bgBrightCyan: this
|
||||
bgBrightWhite: this
|
||||
open: this
|
||||
close: this
|
||||
colors: this
|
||||
}
|
||||
declare const colors: Colors
|
||||
export default colors
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
import { addPath, enableForDir, removePath } from 'app-module-path';
|
||||
|
||||
addPath('/tmp');
|
||||
|
||||
enableForDir('/tmp');
|
||||
|
||||
removePath('/tmp');
|
||||
Vendored
+11
@@ -0,0 +1,11 @@
|
||||
// Type definitions for app-module-path 2.2
|
||||
// Project: https://github.com/patrick-steele-idem/app-module-path-node
|
||||
// Definitions by: Timur Manyanov <https://github.com/darkwebdev>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
|
||||
export function addPath(path: string, parent?: any): void;
|
||||
|
||||
export function enableForDir(dir: string): void;
|
||||
|
||||
export function removePath(path: string): void;
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"app-module-path-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -47,7 +47,8 @@ appInsights = {
|
||||
startTrackEvent(name: string) { return null; },
|
||||
stopTrackEvent(name: string, properties?: { [name: string]: string; }, measurements?: { [name: string]: number; }) { return null; },
|
||||
trackEvent(name: string, properties?: { [name: string]: string; }, measurements?: { [name: string]: number; }) { return null; },
|
||||
trackDependency(id: string, method: string, absoluteUrl: string, pathName: string, totalTime: number, success: boolean, resultCode: number) { return null; },
|
||||
trackDependency(id: string, method: string, absoluteUrl: string, pathName: string, totalTime: number, success: boolean,
|
||||
resultCode: number, properties?: { [name: string]: string }, measurements?: { [name: string]: number }) { return null; },
|
||||
trackException(exception: Error, handledAt?: string, properties?: { [name: string]: string; }, measurements?: { [name: string]: number; }, severityLevel?: AI.SeverityLevel) { return null; },
|
||||
trackMetric(name: string, average: number, sampleCount?: number, min?: number, max?: number, properties?: { [name: string]: string; }) { return null; },
|
||||
trackTrace(message: string, properties?: { [name: string]: string; }, severityLevel?: AI.SeverityLevel) { return null; },
|
||||
@@ -86,7 +87,7 @@ appInsights.trackTrace("message", null);
|
||||
appInsights.trackTrace("message", { a: '1', b: '2' }, AI.SeverityLevel.Error);
|
||||
|
||||
// trackDependency
|
||||
appInsights.trackDependency("id", "POST", "http://example.com/test/abc", "/test/abc", null, true, null);
|
||||
appInsights.trackDependency("id", "POST", "http://example.com/test/abc", "/test/abc", null, true, null, {prop1: 'abc'}, {meas1: 4.5});
|
||||
|
||||
// flush
|
||||
appInsights.flush();
|
||||
|
||||
+14
-9
@@ -670,14 +670,16 @@ declare module Microsoft.ApplicationInsights {
|
||||
context: ITelemetryContext;
|
||||
queue: Array<() => void>;
|
||||
/**
|
||||
* Starts timing how long the user views a page or other item. Call this when the page opens.
|
||||
* This method doesn't send any telemetry. Call {@link stopTrackTelemetry} to log the page when it closes.
|
||||
* Starts the timer for tracking a page load time. Use this instead of `trackPageView` if you want to control when the page view timer starts and stops,
|
||||
* but don't want to calculate the duration yourself. This method doesn't send any telemetry. Call `stopTrackPage` to log the end of the page view
|
||||
* and send the event.
|
||||
* @param name A string that idenfities this item, unique within this HTML document. Defaults to the document title.
|
||||
*/
|
||||
startTrackPage(name?: string): any;
|
||||
/**
|
||||
* Logs how long a page or other item was visible, after {@link startTrackPage}. Call this when the page closes.
|
||||
* @param name The string you used as the name in startTrackPage. Defaults to the document title.
|
||||
* Stops the timer that was started by calling `startTrackPage` and sends the pageview load time telemetry with the specified properties and measurements.
|
||||
* The duration of the page view will be the time between calling `startTrackPage` and `stopTrackPage`.
|
||||
* @param name The string you used as the name in `startTrackPage`. Defaults to the document title.
|
||||
* @param url String - a relative or absolute URL that identifies the page or other item. Defaults to the window location.
|
||||
* @param properties map[string, string] - additional data used to filter pages and metrics in the portal. Defaults to empty.
|
||||
* @param measurements map[string, number] - metrics associated with this page, displayed in Metrics Explorer on the portal. Defaults to empty.
|
||||
@@ -689,7 +691,7 @@ declare module Microsoft.ApplicationInsights {
|
||||
measurements?: { [name: string]: number }): any;
|
||||
/**
|
||||
* Logs that a page or other item was viewed.
|
||||
* @param name The string you used as the name in startTrackPage. Defaults to the document title.
|
||||
* @param name The string you used as the name in `startTrackPage`. Defaults to the document title.
|
||||
* @param url String - a relative or absolute URL that identifies the page or other item. Defaults to the window location.
|
||||
* @param properties map[string, string] - additional data used to filter pages and metrics in the portal. Defaults to empty.
|
||||
* @param measurements map[string, number] - metrics associated with this page, displayed in Metrics Explorer on the portal. Defaults to empty.
|
||||
@@ -701,13 +703,13 @@ declare module Microsoft.ApplicationInsights {
|
||||
properties?: { [name: string]: string },
|
||||
measurements?: { [name: string]: number }, duration?: number): any;
|
||||
/**
|
||||
* Start timing an extended event. Call {@link stopTrackEvent} to log the event when it ends.
|
||||
* Start timing an extended event. Call `stopTrackEvent` to log the event when it ends.
|
||||
* @param name A string that identifies this event uniquely within the document.
|
||||
*/
|
||||
startTrackEvent(name: string): any;
|
||||
/**
|
||||
* Log an extended event that you started timing with {@link startTrackEvent}.
|
||||
* @param name The string you used to identify this event in startTrackEvent.
|
||||
* Log an extended event that you started timing with `startTrackEvent`.
|
||||
* @param name The string you used to identify this event in `startTrackEvent`.
|
||||
* @param properties map[string, string] - additional data used to filter events and metrics in the portal. Defaults to empty.
|
||||
* @param measurements map[string, number] - metrics associated with this event, displayed in Metrics Explorer on the portal. Defaults to empty.
|
||||
*/
|
||||
@@ -734,8 +736,11 @@ declare module Microsoft.ApplicationInsights {
|
||||
* @param totalTime total request time
|
||||
* @param success indicates if the request was sessessful
|
||||
* @param resultCode response code returned by the dependency request
|
||||
* @param properties map[string, string] - additional data used to filter events and metrics in the portal. Defaults to empty.
|
||||
* @param measurements map[string, number] - metrics associated with this event, displayed in Metrics Explorer on the portal. Defaults to empty.
|
||||
*/
|
||||
trackDependency(id: string, method: string, absoluteUrl: string, pathName: string, totalTime: number, success: boolean, resultCode: number): any;
|
||||
trackDependency(id: string, method: string, absoluteUrl: string, pathName: string, totalTime: number, success: boolean, resultCode: number,
|
||||
properties?: { [name: string]: string }, measurements?: { [name: string]: number }): any;
|
||||
/**
|
||||
* Log an exception you have caught.
|
||||
* @param exception An Error from a catch clause, or the string error message.
|
||||
|
||||
@@ -16,6 +16,9 @@ coll.save({ username: "user" });
|
||||
const doc = coll.any();
|
||||
console.log(doc.username);
|
||||
|
||||
const coll2 = db._collection(coll.name());
|
||||
console.log(coll2 === coll);
|
||||
|
||||
const users = coll as ArangoDB.Collection<User>;
|
||||
const admin = users.firstExample({ username: "admin" })!;
|
||||
users.update(admin, { password: md5("hunter2") });
|
||||
|
||||
Vendored
+67
@@ -619,6 +619,7 @@ declare namespace ArangoDB {
|
||||
|
||||
interface Collection<T extends object = any> {
|
||||
// Collection
|
||||
name(): string;
|
||||
checksum(
|
||||
withRevisions?: boolean,
|
||||
withData?: boolean
|
||||
@@ -1440,6 +1441,72 @@ declare module "@arangodb/foxx/router" {
|
||||
export = createRouter;
|
||||
}
|
||||
|
||||
declare module "@arangodb/foxx/queues" {
|
||||
interface QueueItem {
|
||||
name: string;
|
||||
mount: string;
|
||||
backOff?: ((failureCount: number) => number) | number;
|
||||
maxFailures?: number;
|
||||
schema?: Foxx.Schema;
|
||||
preprocess?: (data: any) => any;
|
||||
}
|
||||
|
||||
interface Script {
|
||||
name: string;
|
||||
mount: string;
|
||||
}
|
||||
|
||||
type JobCallback = (result: any, jobData: any, job: ArangoDB.Document<Job>) => void;
|
||||
|
||||
interface Job {
|
||||
status: string;
|
||||
queue: string;
|
||||
type: Script;
|
||||
failures: object[];
|
||||
runs: number;
|
||||
data: any;
|
||||
created: number;
|
||||
modified: number;
|
||||
delayUntil: number;
|
||||
maxFailures: number;
|
||||
repeatDelay: number;
|
||||
repeatTimes: number;
|
||||
repeatUntil: number;
|
||||
success?: string;
|
||||
failure?: string;
|
||||
runFailures: number;
|
||||
abort(): void;
|
||||
}
|
||||
|
||||
interface JobOptions {
|
||||
success?: JobCallback;
|
||||
failure?: JobCallback;
|
||||
delayUntil?: number | Date;
|
||||
backOff?: ((failureCount: number) => number) | number;
|
||||
maxFailures?: number;
|
||||
repeatTimes?: number;
|
||||
repeatUntil?: number | Date;
|
||||
repeatDelay?: number;
|
||||
}
|
||||
|
||||
interface Queue {
|
||||
push(item: QueueItem, data: any, opts?: JobOptions): void;
|
||||
get(jobId: string): ArangoDB.Document<Job>;
|
||||
delete(jobId: string): boolean;
|
||||
pending(script?: Script): string[];
|
||||
progress(script?: Script): string[];
|
||||
complete(script?: Script): string[];
|
||||
failed(script?: Script): string[];
|
||||
all(script?: Script): string[];
|
||||
}
|
||||
|
||||
function createQueue(name: string, maxWorkers?: number): Queue;
|
||||
function deleteQueue(name: string): boolean;
|
||||
function get(name: string): Queue;
|
||||
|
||||
export { createQueue as create, deleteQueue as delete, get, JobOptions, Job, Queue, QueueItem, Script, };
|
||||
}
|
||||
|
||||
declare module "@arangodb/foxx/graphql" {
|
||||
import { formatError, GraphQLSchema } from "graphql";
|
||||
type GraphQLModule = object;
|
||||
|
||||
@@ -390,22 +390,22 @@ async.auto({
|
||||
get_data: function (callback: AsyncResultCallback<any>) { },
|
||||
make_folder: function (callback: AsyncResultCallback<any>) { },
|
||||
//arrays with different types are not accepted by TypeScript.
|
||||
write_file: ['get_data', 'make_folder', <any>function (callback: AsyncResultCallback<any>) {
|
||||
write_file: ['get_data', 'make_folder', function (callback: AsyncResultCallback<any>) {
|
||||
callback(null, filename);
|
||||
}],
|
||||
} as any],
|
||||
//arrays with different types are not accepted by TypeScript.
|
||||
email_link: ['write_file', <any>function (callback: AsyncResultCallback<any>, results: any) { }]
|
||||
email_link: ['write_file', function (callback: AsyncResultCallback<any>, results: any) { } as any]
|
||||
});
|
||||
|
||||
async.auto({
|
||||
get_data: function (callback: AsyncResultCallback<any>) { },
|
||||
make_folder: function (callback: AsyncResultCallback<any>) { },
|
||||
//arrays with different types are not accepted by TypeScript.
|
||||
write_file: ['get_data', 'make_folder', <any>function (callback: AsyncResultCallback<any>) {
|
||||
write_file: ['get_data', 'make_folder', function (callback: AsyncResultCallback<any>) {
|
||||
callback(null, filename);
|
||||
}],
|
||||
} as any],
|
||||
//arrays with different types are not accepted by TypeScript.
|
||||
email_link: ['write_file', <any>function (callback: AsyncResultCallback<any>, results: any) { }]
|
||||
email_link: ['write_file', function (callback: AsyncResultCallback<any>, results: any) { } as any]
|
||||
}, function (err, results) {
|
||||
console.log('finished auto');
|
||||
});
|
||||
@@ -421,11 +421,11 @@ async.auto<A>({
|
||||
get_data: function (callback: AsyncResultCallback<any>) { },
|
||||
make_folder: function (callback: AsyncResultCallback<any>) { },
|
||||
//arrays with different types are not accepted by TypeScript.
|
||||
write_file: ['get_data', 'make_folder', <any>function (callback: AsyncResultCallback<any>) {
|
||||
write_file: ['get_data', 'make_folder', function (callback: AsyncResultCallback<any>) {
|
||||
callback(null, filename);
|
||||
}],
|
||||
} as any],
|
||||
//arrays with different types are not accepted by TypeScript.
|
||||
email_link: ['write_file', <any>function (callback: AsyncResultCallback<any>, results: any) { }]
|
||||
email_link: ['write_file', function (callback: AsyncResultCallback<any>, results: any) { } as any]
|
||||
}, 1, function (err, results) {
|
||||
console.log('finished auto');
|
||||
});
|
||||
|
||||
@@ -1 +1,6 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"no-angle-bracket-type-assertion": false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -557,8 +557,8 @@ function testDesializerManager() {
|
||||
}
|
||||
|
||||
function isStorableClass(o: object): o is StorableClass {
|
||||
if (typeof o === "object" && (<StorableClass> o).name &&
|
||||
(<StorableClass> o).name === "test") {
|
||||
if (typeof o === "object" && (o as StorableClass).name &&
|
||||
(o as StorableClass).name === "test") {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
|
||||
Vendored
+1
-3
@@ -1,11 +1,9 @@
|
||||
// Type definitions for auth0 2.9.2
|
||||
// Project: https://github.com/auth0/node-auth0
|
||||
// Definitions by: Wilson Hobbs <https://github.com/wbhob>, Seth Westphal <https://github.com/westy92>, Amiram Korach <https://github.com/amiram>
|
||||
// Definitions by: Seth Westphal <https://github.com/westy92>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
import * as Promise from 'bluebird';
|
||||
|
||||
export interface ManagementClientOptions {
|
||||
token?: string;
|
||||
domain: string;
|
||||
|
||||
Vendored
+1
@@ -2,6 +2,7 @@
|
||||
// Project: https://github.com/postcss/autoprefixer
|
||||
// Definitions by: Armando Meziat <https://github.com/odnamrataizem>, murt <https://github.com/murt>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
import { Plugin } from "postcss";
|
||||
|
||||
|
||||
@@ -0,0 +1,131 @@
|
||||
import Timeout from "await-timeout";
|
||||
|
||||
/**
|
||||
* This test is just a TS-friendly version of the await-timeout README:
|
||||
* https://github.com/vitalets/await-timeout/blob/v0.3.0/README.md
|
||||
*
|
||||
* How to generate this file:
|
||||
* 1. Paste the source code of README.md
|
||||
* 2. Replace every code fence with async () => {}
|
||||
* 3. Comment out all other lines
|
||||
* 4. Add and remove import statements and repeated statements
|
||||
* 5. Declare required globals
|
||||
*/
|
||||
|
||||
// -- Globals --
|
||||
declare const fetch: (url: string) => Promise<any>;
|
||||
declare const console: any;
|
||||
declare const MyTimeoutError: any;
|
||||
|
||||
// --- README ---
|
||||
|
||||
// ## Usage
|
||||
// 1. Just wait some time:
|
||||
async () => {
|
||||
// wait 1000 ms and resolve
|
||||
await Timeout.set(1000);
|
||||
|
||||
// wait 1000 ms and reject with 'Error'
|
||||
await Timeout.set(1000, 'Error');
|
||||
};
|
||||
|
||||
// 2. Use `Timeout` instance inside `try...finally` block to make proper cleanup:
|
||||
async () => {
|
||||
const timer = new Timeout();
|
||||
try {
|
||||
await Promise.race([
|
||||
fetch('https://example.com'),
|
||||
timer.set(1000)
|
||||
.then(() => Promise.reject('Timeout'))
|
||||
]);
|
||||
} finally {
|
||||
timer.clear();
|
||||
}
|
||||
};
|
||||
|
||||
// ## API
|
||||
// ### new Timeout()
|
||||
// Constructs new timeout instance. It does not start timer but creates variable for timer manipulation.
|
||||
async () => {
|
||||
const timer = new Timeout();
|
||||
};
|
||||
// > Note : having separate variable is useful for clearing timeout in `finally` block
|
||||
|
||||
// ### .set(ms, [message]) ⇒ `Promise`
|
||||
// Starts new timer like `setTimeout()` and returns promise. The promise will be resolved after `ms` milliseconds:
|
||||
async () => {
|
||||
const timer = new Timeout();
|
||||
timer.set(1000)
|
||||
.then(() => console.log('1000 ms passed.'));
|
||||
};
|
||||
|
||||
// If you need to reject after timeout:
|
||||
async () => {
|
||||
const timer = new Timeout();
|
||||
timer.set(1000)
|
||||
.then(() => {throw new Error('Timeout'); });
|
||||
};
|
||||
|
||||
// Or reject with custom error:
|
||||
async () => {
|
||||
const timer = new Timeout();
|
||||
timer.set(1000)
|
||||
.then(() => {throw new MyTimeoutError(); });
|
||||
};
|
||||
// The second parameter `message` is just convenient way to reject with `new Error(message)`:
|
||||
async () => {
|
||||
const timer = new Timeout();
|
||||
timer.set(1000, 'Timeout');
|
||||
// is equivalent to
|
||||
timer.set(1000).then(() => {throw new Error('Timeout'); });
|
||||
};
|
||||
|
||||
// If you need to just wait some time - use static version of `.set()` :
|
||||
async () => {
|
||||
Timeout.set(1000).then(/*...*/);
|
||||
};
|
||||
|
||||
// ### .wrap(promise, ms, [message]) ⇒ `Promise`
|
||||
// Wraps existing promise with timeout:
|
||||
// * promise automatically rejected after timeout
|
||||
// * timeout automatically cleared if promise fulfills first
|
||||
async () => {
|
||||
const promise = fetch('https://example.com');
|
||||
|
||||
const timeoutedPromise = Timeout.wrap(promise, 1000, 'Timeout');
|
||||
};
|
||||
// Actually it is a shortcut for :
|
||||
async () => {
|
||||
const promise = fetch('https://example.com');
|
||||
|
||||
const timer = new Timeout();
|
||||
try {
|
||||
const timeoutedPromise = await Promise.race([
|
||||
promise,
|
||||
timer.set(1000, 'Timeout')
|
||||
]);
|
||||
} finally {
|
||||
timer.clear();
|
||||
}
|
||||
};
|
||||
|
||||
// ### .clear()
|
||||
// Clears existing timeout like `clearTimeout()`.
|
||||
async () => {
|
||||
const timer = new Timeout();
|
||||
timer.set(1000)
|
||||
.then(() => console.log('This will never be called, because timeout is cleared on the next line'));
|
||||
timer.clear();
|
||||
};
|
||||
|
||||
// With [ES7 async / await ] `.clear()` can be used in `finally` block:
|
||||
async () => {
|
||||
async function foo() {
|
||||
const timer = new Timeout();
|
||||
try {
|
||||
// some async stuff
|
||||
} finally {
|
||||
timer.clear();
|
||||
}
|
||||
}
|
||||
};
|
||||
Vendored
+18
@@ -0,0 +1,18 @@
|
||||
// Type definitions for await-timeout 0.3
|
||||
// Project: https://github.com/vitalets/await-timeout
|
||||
// Definitions by: Sean Zhu <https://github.com/szhu>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.1
|
||||
|
||||
export default Timeout;
|
||||
|
||||
declare class Timeout {
|
||||
static set(delay: number): Promise<undefined>;
|
||||
static set(delay: number, message: string): Promise<never>;
|
||||
|
||||
static wrap(promise: Promise<any>, delay: number, error?: string): Promise<any>;
|
||||
|
||||
set(delay: number): Promise<undefined>;
|
||||
set(delay: number, message: string): Promise<never>;
|
||||
clear(): void;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"await-timeout-tests.ts"
|
||||
]
|
||||
}
|
||||
Vendored
+1
-1
@@ -75,7 +75,7 @@ export namespace Azure.ServiceBus {
|
||||
DefaultMessageTimeToLive: string;
|
||||
DuplicateDetectionHistoryTimeWindow: string;
|
||||
EnablePartitioning: boolean;
|
||||
MaxSizeInMegaBytes: number;
|
||||
MaxSizeInMegabytes: number;
|
||||
RequiresDuplicateDetection: boolean;
|
||||
}
|
||||
|
||||
|
||||
@@ -7,15 +7,18 @@ const options: babel.TransformOptions = {
|
||||
|
||||
babel.transform("code();", options, (err, result) => {
|
||||
const { code, map, ast } = result!;
|
||||
const { body } = ast!.program;
|
||||
});
|
||||
|
||||
const transformSyncResult = babel.transformSync("code();", options);
|
||||
if (transformSyncResult) {
|
||||
const { code, map, ast } = transformSyncResult;
|
||||
const { body } = ast!.program;
|
||||
}
|
||||
|
||||
babel.transformFile("filename.js", options, (err, result) => {
|
||||
const { code, map, ast } = result!;
|
||||
const { body } = ast!.program;
|
||||
});
|
||||
|
||||
babel.transformFileSync("filename.js", options)!.code;
|
||||
@@ -25,7 +28,14 @@ const parsedAst = babel.parse(sourceCode, options);
|
||||
|
||||
babel.transformFromAst(parsedAst!, sourceCode, options, (err, result) => {
|
||||
const { code, map, ast } = result!;
|
||||
const { body } = ast!.program;
|
||||
});
|
||||
|
||||
const transformFromAstSyncResult = babel.transformFromAstSync(parsedAst!, sourceCode, options);
|
||||
const { code, map, ast } = transformFromAstSyncResult!;
|
||||
const { body } = ast!.program;
|
||||
|
||||
babel.transformFromAstAsync(parsedAst!, sourceCode, options).then(transformFromAstAsyncResult => {
|
||||
const { code, map, ast } = transformFromAstAsyncResult!;
|
||||
const { body } = ast!.program;
|
||||
});
|
||||
|
||||
Vendored
+6
-6
@@ -4,16 +4,16 @@
|
||||
// Marvin Hagemeister <https://github.com/marvinhagemeister>
|
||||
// Melvin Groenhoff <https://github.com/mgroenhoff>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
// TypeScript Version: 2.9
|
||||
|
||||
import { GeneratorOptions } from "@babel/generator";
|
||||
import traverse, { Visitor, NodePath } from "@babel/traverse";
|
||||
import template from "@babel/template";
|
||||
import * as t from "@babel/types";
|
||||
import { ParseOptions } from "@babel/parser";
|
||||
import { ParserOptions } from "@babel/parser";
|
||||
|
||||
export {
|
||||
ParseOptions,
|
||||
ParserOptions,
|
||||
GeneratorOptions,
|
||||
t as types,
|
||||
template,
|
||||
@@ -217,7 +217,7 @@ export interface TransformOptions {
|
||||
*
|
||||
* Default: `{}`
|
||||
*/
|
||||
parserOpts?: ParseOptions | null;
|
||||
parserOpts?: ParserOptions | null;
|
||||
|
||||
/**
|
||||
* List of plugins to load and use
|
||||
@@ -349,7 +349,7 @@ export function transformFromAstSync(ast: Node, code?: string, opts?: TransformO
|
||||
/**
|
||||
* Given an AST, transform it.
|
||||
*/
|
||||
export function transformFromAstSync(ast: Node, code?: string, opts?: TransformOptions): Promise<BabelFileResult | null>;
|
||||
export function transformFromAstAsync(ast: Node, code?: string, opts?: TransformOptions): Promise<BabelFileResult | null>;
|
||||
|
||||
// A babel plugin is a simple function which must return an object matching
|
||||
// the following interface. Babel will throw if it finds unknown properties.
|
||||
@@ -365,7 +365,7 @@ export interface PluginObj<S = {}> {
|
||||
}
|
||||
|
||||
export interface BabelFileResult {
|
||||
ast?: Node | null;
|
||||
ast?: t.File | null;
|
||||
code?: string | null;
|
||||
ignored?: boolean;
|
||||
map?: {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@babel/types": "^7.0.0-beta.54"
|
||||
"@babel/parser": "^7.1.0",
|
||||
"@babel/types": "^7.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,9 +22,6 @@
|
||||
"@babel/generator": [
|
||||
"babel__generator"
|
||||
],
|
||||
"@babel/parser": [
|
||||
"babel__parser"
|
||||
],
|
||||
"@babel/template": [
|
||||
"babel__template"
|
||||
],
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
// Example from https://github.com/babel/babel/tree/master/packages/babel-generator
|
||||
import generate from "@babel/generator";
|
||||
import { parse } from "@babel/parser";
|
||||
import * as t from "@babel/types";
|
||||
|
||||
const code = "class Example {}";
|
||||
const ast = parse(code);
|
||||
declare const ast: t.Node;
|
||||
|
||||
ast.type;
|
||||
ast.loc!.start;
|
||||
|
||||
Vendored
+1
-1
@@ -4,7 +4,7 @@
|
||||
// Johnny Estilles <https://github.com/johnnyestilles>
|
||||
// Melvin Groenhoff <https://github.com/mgroenhoff>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
// TypeScript Version: 2.9
|
||||
|
||||
import * as t from "@babel/types";
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@babel/types": "^7.0.0-beta.54"
|
||||
"@babel/types": "^7.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,9 +18,6 @@
|
||||
"paths": {
|
||||
"@babel/generator": [
|
||||
"babel__generator"
|
||||
],
|
||||
"@babel/parser": [
|
||||
"babel__parser"
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
import { parse, parseExpression } from "@babel/parser";
|
||||
|
||||
declare function assert(expr: boolean): void;
|
||||
|
||||
const code = `function square(n) {
|
||||
return n * n;
|
||||
}`;
|
||||
|
||||
const node = parse(code);
|
||||
assert(node.type === "File");
|
||||
assert(node.start === 0);
|
||||
assert(node.end === 38);
|
||||
assert(!!node.loc && node.loc.start > node.loc.end);
|
||||
|
||||
parse(code, {
|
||||
sourceType: "module", // default: "script"
|
||||
plugins: ["jsx"] // default: []
|
||||
});
|
||||
Vendored
-107
@@ -1,107 +0,0 @@
|
||||
// Type definitions for @babel/parser 7.0
|
||||
// Project: https://github.com/babel/babel/tree/master/packages/babel-parser
|
||||
// Definitions by: Troy Gerwien <https://github.com/yortus>
|
||||
// Marvin Hagemeister <https://github.com/marvinhagemeister>
|
||||
// Melvin Groenhoff <https://github.com/mgroenhoff>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
import { File, Expression } from "@babel/types";
|
||||
|
||||
export function parse(code: string, opts?: ParseOptions): File;
|
||||
|
||||
export function parseExpression(input: string, options?: ParseOptions): Expression;
|
||||
|
||||
export interface ParseOptions {
|
||||
/**
|
||||
* By default, import and export declarations can only appear at a program's top level.
|
||||
* Setting this option to true allows them anywhere where a statement is allowed.
|
||||
*/
|
||||
allowImportExportEverywhere?: boolean;
|
||||
|
||||
/**
|
||||
* By default, await use is not allowed outside of an async function. Set this to true to accept such code.
|
||||
*/
|
||||
allowAwaitOutsideFunction?: boolean;
|
||||
|
||||
/**
|
||||
* By default, a return statement at the top level raises an error. Set this to true to accept such code.
|
||||
*/
|
||||
allowReturnOutsideFunction?: boolean;
|
||||
|
||||
allowSuperOutsideMethod?: boolean;
|
||||
|
||||
/**
|
||||
* Indicate the mode the code should be parsed in. Can be one of "script", "module", or "unambiguous".
|
||||
* Defaults to "script". "unambiguous" will make @babel/parser attempt to guess, based on the presence of ES6 import or export
|
||||
* statements. Files with ES6 imports and exports are considered "module" and are otherwise "script".
|
||||
*/
|
||||
sourceType?: "script" | "module" | "unambiguous";
|
||||
|
||||
/**
|
||||
* Correlate output AST nodes with their source filename. Useful when
|
||||
* generating code and source maps from the ASTs of multiple input files.
|
||||
*/
|
||||
sourceFilename?: string;
|
||||
|
||||
/**
|
||||
* By default, the first line of code parsed is treated as line 1. You can provide a line number to alternatively start with. Useful
|
||||
* for integration with other source tools.
|
||||
*/
|
||||
startLine?: number;
|
||||
|
||||
/**
|
||||
* Array containing the plugins that you want to enable.
|
||||
*/
|
||||
plugins?: PluginList;
|
||||
|
||||
strictMode?: boolean;
|
||||
|
||||
/**
|
||||
* Adds a `ranges` property to each node: `[node.start, node.end]`
|
||||
*/
|
||||
ranges?: boolean;
|
||||
|
||||
/**
|
||||
* Adds all parsed tokens to a `tokens` property on the `File` node
|
||||
*/
|
||||
tokens?: boolean;
|
||||
}
|
||||
|
||||
export type PluginList = Array<PluginName | [PluginName, PluginOptions]>;
|
||||
|
||||
export type PluginName =
|
||||
"asyncGenerators" |
|
||||
"bigInt" |
|
||||
"classPrivateMethods" |
|
||||
"classPrivateProperties" |
|
||||
"classProperties" |
|
||||
"decorators" |
|
||||
"doExpressions" |
|
||||
"dynamicImport" |
|
||||
"estree" |
|
||||
"exportDefaultFrom" |
|
||||
"exportNamespaceFrom" |
|
||||
"flow" |
|
||||
"flowComments" |
|
||||
"functionBind" |
|
||||
"functionSent" |
|
||||
"importMeta" |
|
||||
"jsx" |
|
||||
"nullishCoalescingOperator" |
|
||||
"numericSeparator" |
|
||||
"objectRestSpread" |
|
||||
"optionalCatchBinding" |
|
||||
"optionalChaining" |
|
||||
"pipelineOperator" |
|
||||
"throwExpressions" |
|
||||
"typescript";
|
||||
|
||||
export interface PluginOptions {
|
||||
decorators?: {
|
||||
decoratorsBeforeExport?: boolean;
|
||||
};
|
||||
flow?: {
|
||||
all?: boolean;
|
||||
};
|
||||
}
|
||||
Vendored
+3
-3
@@ -4,12 +4,12 @@
|
||||
// Marvin Hagemeister <https://github.com/marvinhagemeister>
|
||||
// Melvin Groenhoff <https://github.com/mgroenhoff>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
// TypeScript Version: 2.9
|
||||
|
||||
import { ParseOptions } from "@babel/parser";
|
||||
import { ParserOptions } from "@babel/parser";
|
||||
import { Expression, File, Program, Statement } from "@babel/types";
|
||||
|
||||
export interface TemplateBuilderOptions extends ParseOptions {
|
||||
export interface TemplateBuilderOptions extends ParserOptions {
|
||||
/**
|
||||
* A set of placeholder names to automatically accept. Items in this list do not need to match the given placeholder pattern.
|
||||
*/
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@babel/types": "^7.0.0-beta.54"
|
||||
"@babel/parser": "^7.1.0",
|
||||
"@babel/types": "^7.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,9 +20,6 @@
|
||||
"@babel/generator": [
|
||||
"babel__generator"
|
||||
],
|
||||
"@babel/parser": [
|
||||
"babel__parser"
|
||||
],
|
||||
"@babel/template": [
|
||||
"babel__template"
|
||||
]
|
||||
|
||||
@@ -1,14 +1,17 @@
|
||||
import { parse } from "@babel/parser";
|
||||
import traverse, { Visitor } from "@babel/traverse";
|
||||
import * as t from "@babel/types";
|
||||
|
||||
// Examples from: https://github.com/thejameskyle/babel-handbook/blob/master/translations/en/plugin-handbook.md
|
||||
const MyVisitor: Visitor = {
|
||||
Identifier: {
|
||||
enter() {
|
||||
enter(path) {
|
||||
// $ExpectType NodePath<Identifier>
|
||||
path;
|
||||
console.log("Entered!");
|
||||
},
|
||||
exit() {
|
||||
exit(path) {
|
||||
// $ExpectType NodePath<Identifier>
|
||||
path;
|
||||
console.log("Exited!");
|
||||
}
|
||||
}
|
||||
@@ -21,11 +24,7 @@ const MyVisitor2: Visitor = {
|
||||
};
|
||||
|
||||
// Example from https://github.com/thejameskyle/babel-handbook/blob/master/translations/en/plugin-handbook.md#babel-traverse
|
||||
const code = `function square(n) {
|
||||
return n * n;
|
||||
}`;
|
||||
|
||||
const ast = parse(code);
|
||||
declare const ast: t.Node;
|
||||
|
||||
traverse(ast, {
|
||||
enter(path) {
|
||||
@@ -94,7 +93,8 @@ const v1: Visitor = {
|
||||
|
||||
const id = path.scope.generateUidIdentifierBasedOnNode(path.node.id!);
|
||||
path.remove();
|
||||
path.scope.parent.push({ id, init: path.node });
|
||||
path.scope.parent.push({ id });
|
||||
path.scope.parent.push({ id, init: t.stringLiteral('foo'), kind: "const" });
|
||||
|
||||
path.scope.rename("n", "x");
|
||||
path.scope.rename("n");
|
||||
@@ -109,7 +109,44 @@ const BindingKindTest: Visitor = {
|
||||
kind === 'const';
|
||||
kind === 'let';
|
||||
kind === 'var';
|
||||
// The following should fail when uncommented
|
||||
// kind === 'anythingElse';
|
||||
// $ExpectError
|
||||
kind === 'anythingElse';
|
||||
},
|
||||
};
|
||||
|
||||
interface SomeVisitorState { someState: string; }
|
||||
|
||||
const VisitorStateTest: Visitor<SomeVisitorState> = {
|
||||
enter(path, state) {
|
||||
// $ExpectType SomeVisitorState
|
||||
state;
|
||||
// $ExpectType SomeVisitorState
|
||||
this;
|
||||
},
|
||||
exit(path, state) {
|
||||
// $ExpectType SomeVisitorState
|
||||
state;
|
||||
// $ExpectType SomeVisitorState
|
||||
this;
|
||||
},
|
||||
Identifier(path, state) {
|
||||
// $ExpectType SomeVisitorState
|
||||
state;
|
||||
// $ExpectType SomeVisitorState
|
||||
this;
|
||||
},
|
||||
FunctionDeclaration: {
|
||||
enter(path, state) {
|
||||
// $ExpectType SomeVisitorState
|
||||
state;
|
||||
// $ExpectType SomeVisitorState
|
||||
this;
|
||||
},
|
||||
exit(path, state) {
|
||||
// $ExpectType SomeVisitorState
|
||||
state;
|
||||
// $ExpectType SomeVisitorState
|
||||
this;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Vendored
+15
-10
@@ -5,7 +5,7 @@
|
||||
// Ryan Petrich <https://github.com/rpetrich>
|
||||
// Melvin Groenhoff <https://github.com/mgroenhoff>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
// TypeScript Version: 2.9
|
||||
|
||||
import * as t from "@babel/types";
|
||||
|
||||
@@ -90,11 +90,16 @@ export class Scope {
|
||||
|
||||
removeData(key: string): void;
|
||||
|
||||
push(opts: any): void;
|
||||
push(opts: {
|
||||
id: t.LVal,
|
||||
init?: t.Expression,
|
||||
unique?: boolean,
|
||||
kind?: "var" | "let" | "const",
|
||||
}): void;
|
||||
|
||||
getProgramParent(): Scope;
|
||||
|
||||
getFunctionParent(): Scope;
|
||||
getFunctionParent(): Scope | null;
|
||||
|
||||
getBlockParent(): Scope;
|
||||
|
||||
@@ -138,17 +143,17 @@ export class Binding {
|
||||
constantViolations: NodePath[];
|
||||
}
|
||||
|
||||
export type Visitor<S = Node> = VisitNodeObject<Node> & {
|
||||
[P in Node["type"]]?: VisitNode<S, Extract<Node, { type: P; }>>;
|
||||
export type Visitor<S = {}> = VisitNodeObject<S, Node> & {
|
||||
[Type in Node["type"]]?: VisitNode<S, Extract<Node, { type: Type; }>>;
|
||||
};
|
||||
|
||||
export type VisitNode<T, P> = VisitNodeFunction<T, P> | VisitNodeObject<T>;
|
||||
export type VisitNode<S, P> = VisitNodeFunction<S, P> | VisitNodeObject<S, P>;
|
||||
|
||||
export type VisitNodeFunction<T, P> = (this: T, path: NodePath<P>, state: any) => void;
|
||||
export type VisitNodeFunction<S, P> = (this: S, path: NodePath<P>, state: S) => void;
|
||||
|
||||
export interface VisitNodeObject<T> {
|
||||
enter?(path: NodePath<T>, state: any): void;
|
||||
exit?(path: NodePath<T>, state: any): void;
|
||||
export interface VisitNodeObject<S, P> {
|
||||
enter?: VisitNodeFunction<S, P>;
|
||||
exit?: VisitNodeFunction<S, P>;
|
||||
}
|
||||
|
||||
export class NodePath<T = Node> {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@babel/types": "^7.0.0-beta.54"
|
||||
"@babel/types": "^7.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,9 +17,6 @@
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"paths": {
|
||||
"@babel/parser": [
|
||||
"babel__parser"
|
||||
],
|
||||
"@babel/traverse": [
|
||||
"babel__traverse"
|
||||
]
|
||||
|
||||
Vendored
+1
@@ -46,6 +46,7 @@ export type PluginName =
|
||||
'estree' |
|
||||
'jsx' |
|
||||
'flow' |
|
||||
'typescript' |
|
||||
'classConstructorCall' |
|
||||
'doExpressions' |
|
||||
'objectRestSpread' |
|
||||
|
||||
@@ -64,7 +64,7 @@ const modelOpts: Backbone.ModelFetchWithCacheOptions = {
|
||||
context: {},
|
||||
};
|
||||
|
||||
const hoge = <Backbone.ModelWithCache> new Backbone.Model;
|
||||
const hoge = new Backbone.Model() as Backbone.ModelWithCache;
|
||||
hoge.fetch(modelOpts);
|
||||
|
||||
const collectionOpts: Backbone.CollectionFetchWithCacheOptions = {
|
||||
@@ -76,5 +76,5 @@ const collectionOpts: Backbone.CollectionFetchWithCacheOptions = {
|
||||
prefillSuccess: (self: any) => { },
|
||||
};
|
||||
|
||||
const fuga = <Backbone.CollectionWithCache> new Backbone.Collection;
|
||||
const fuga = new Backbone.Collection() as Backbone.CollectionWithCache;
|
||||
fuga.fetch(collectionOpts);
|
||||
|
||||
Vendored
+13
-1
@@ -122,7 +122,19 @@ declare module 'backbone' {
|
||||
|
||||
}
|
||||
|
||||
export class Store extends Events {
|
||||
export class Store implements Events {
|
||||
on(eventName: string, callback?: (...args: any[]) => void, context?: any): any;
|
||||
on(eventMap: EventsHash): any;
|
||||
on(eventName: any, callback?: any, context?: any): any;
|
||||
off(eventName?: string, callback?: (...args: any[]) => void, context?: any): any;
|
||||
trigger(eventName: string, ...args: any[]): any;
|
||||
bind(eventName: string, callback: (...args: any[]) => void, context?: any): any;
|
||||
unbind(eventName?: string, callback?: (...args: any[]) => void, context?: any): any;
|
||||
once(events: string, callback: (...args: any[]) => void, context?: any): any;
|
||||
listenTo(object: any, events: string, callback: (...args: any[]) => void): any;
|
||||
listenToOnce(object: any, events: string, callback: (...args: any[]) => void): any;
|
||||
stopListening(object?: any, events?: string, callback?: (...args: any[]) => void): any;
|
||||
|
||||
initializeRelation(model, relation, options);
|
||||
|
||||
addModelScope(scope:any):void;
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
"max-line-length": false,
|
||||
"member-access": false,
|
||||
"new-parens": false,
|
||||
"no-angle-bracket-type-assertion": false,
|
||||
"no-any-union": false,
|
||||
"no-boolean-literal-compare": false,
|
||||
"no-conditional-assignment": false,
|
||||
|
||||
Vendored
+142
-3
@@ -4,13 +4,15 @@
|
||||
// Natan Vivo <https://github.com/nvivo>,
|
||||
// Sven Tschui <https://github.com/sventschui>,
|
||||
// Volker Nauruhn <https://github.com/razorness>,
|
||||
// Ard Timmerman <https://github.com/confususs>
|
||||
// Ard Timmerman <https://github.com/confususs>,
|
||||
// J. Joe Koullas <https://github.com/jjoekoullas>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
import * as Backbone from 'backbone';
|
||||
import * as JQuery from 'jquery';
|
||||
import * as Radio from 'backbone.radio';
|
||||
import * as _ from 'underscore';
|
||||
|
||||
export as namespace Marionette;
|
||||
|
||||
@@ -179,6 +181,131 @@ export class Container<TView> {
|
||||
* Find a view by it's cid.
|
||||
*/
|
||||
remove(view: TView): void;
|
||||
|
||||
/**
|
||||
* @see _.forEach
|
||||
*/
|
||||
forEach(iterator: _.ListIterator<TView, void>, context?: any): Container<TView>;
|
||||
|
||||
/**
|
||||
* @see _.each
|
||||
*/
|
||||
each(iterator: _.ListIterator<TView, void>, context?: any): Container<TView>;
|
||||
|
||||
/**
|
||||
* @see _.map
|
||||
*/
|
||||
map<TResult>(iterator: _.ListIterator<TView, TResult>, context?: any): TResult[];
|
||||
|
||||
/**
|
||||
* @see _.find
|
||||
*/
|
||||
find(iterator: _.ListIterator<TView, boolean>, context?: any): Container<TView> | undefined;
|
||||
|
||||
/**
|
||||
* @see _.detect
|
||||
*/
|
||||
detect(iterator: _.ListIterator<TView, boolean>, context?: any): Container<TView> | undefined;
|
||||
|
||||
/**
|
||||
* @see _.filter
|
||||
*/
|
||||
filter(iterator: _.ListIterator<TView, boolean>, context?: any): TView[];
|
||||
|
||||
/**
|
||||
* @see _.select
|
||||
*/
|
||||
select(iterator: _.ListIterator<TView, boolean>, context?: any): TView[];
|
||||
|
||||
/**
|
||||
* @see _.reject
|
||||
*/
|
||||
reject(iterator: _.ListIterator<TView, boolean>, context?: any): TView[];
|
||||
|
||||
/**
|
||||
* @see _.every
|
||||
*/
|
||||
every(iterator: _.ListIterator<TView, boolean>, context?: any): boolean;
|
||||
|
||||
/**
|
||||
* @see _.all
|
||||
*/
|
||||
all(iterator: _.ListIterator<TView, boolean>, context?: any): boolean;
|
||||
|
||||
/**
|
||||
* @see _.some
|
||||
*/
|
||||
some(iterator: _.ListIterator<TView, boolean>, context?: any): boolean;
|
||||
|
||||
/**
|
||||
* @see _.any
|
||||
*/
|
||||
any(iterator: _.ListIterator<TView, boolean>, context?: any): boolean;
|
||||
|
||||
/**
|
||||
* @see _.include
|
||||
*/
|
||||
include(value: TView, fromIndex?: number): boolean;
|
||||
|
||||
/**
|
||||
* @see _.contains
|
||||
*/
|
||||
contains(value: TView, fromIndex?: number): boolean;
|
||||
|
||||
/**
|
||||
* @see _.invoke
|
||||
*/
|
||||
invoke(methodName: string, ...args: any[]): any;
|
||||
|
||||
/**
|
||||
* @see _.toArray
|
||||
*/
|
||||
toArray(): TView[];
|
||||
|
||||
/**
|
||||
* @see _.first
|
||||
*/
|
||||
first(): TView | undefined;
|
||||
|
||||
/**
|
||||
* @see _.initial
|
||||
*/
|
||||
initial(n?: number): TView[];
|
||||
|
||||
/**
|
||||
* @see _.rest
|
||||
*/
|
||||
rest(n?: number): TView[];
|
||||
|
||||
/**
|
||||
* @see _.last
|
||||
*/
|
||||
last(n: number): TView[];
|
||||
|
||||
/**
|
||||
* @see _.without
|
||||
*/
|
||||
without(...values: TView[]): TView[];
|
||||
|
||||
/**
|
||||
* @see _.isEmpty
|
||||
*/
|
||||
isEmpty(): boolean;
|
||||
|
||||
/**
|
||||
* @see _.pluck
|
||||
*/
|
||||
pluck(propertyName: string): any[];
|
||||
|
||||
/**
|
||||
* @see _.reduce
|
||||
*/
|
||||
reduce<TResult>(iterator: _.MemoIterator<TView, TResult>, memo?: TResult, context?: any): TResult;
|
||||
|
||||
/**
|
||||
* @see _.partition
|
||||
*/
|
||||
partition(iterator: _.ListIterator<TView, boolean>, context?: any): TView[][];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -280,9 +407,21 @@ export interface ObjectOptions extends RadioMixinOptions {
|
||||
* A base class which other classes can extend from. Object incorporates many
|
||||
* backbone conventions and utilities like initialize and Backbone.Events.
|
||||
*/
|
||||
export class Object extends Backbone.Events implements CommonMixin, RadioMixin {
|
||||
export class Object implements CommonMixin, RadioMixin, Backbone.Events {
|
||||
constructor(options?: ObjectOptions);
|
||||
|
||||
on(eventName: string, callback?: (...args: any[]) => void, context?: any): any;
|
||||
on(eventMap: EventsHash): any;
|
||||
on(eventName: any, callback?: any, context?: any): any;
|
||||
off(eventName?: string, callback?: (...args: any[]) => void, context?: any): any;
|
||||
trigger(eventName: string, ...args: any[]): any;
|
||||
bind(eventName: string, callback: (...args: any[]) => void, context?: any): any;
|
||||
unbind(eventName?: string, callback?: (...args: any[]) => void, context?: any): any;
|
||||
once(events: string, callback: (...args: any[]) => void, context?: any): any;
|
||||
listenTo(object: any, events: string, callback: (...args: any[]) => void): any;
|
||||
listenToOnce(object: any, events: string, callback: (...args: any[]) => void): any;
|
||||
stopListening(object?: any, events?: string, callback?: (...args: any[]) => void): any;
|
||||
|
||||
/**
|
||||
* Receives a hash of event names and functions and/or function names,
|
||||
* and returns the same hash with the function names replaced with the
|
||||
@@ -1154,7 +1293,7 @@ export class View<TModel extends Backbone.Model> extends Backbone.View<TModel> i
|
||||
export interface CollectionViewOptions<
|
||||
TModel extends Backbone.Model,
|
||||
TCollection extends Backbone.Collection<TModel> = Backbone.Collection<TModel>
|
||||
> extends Backbone.ViewOptions<TModel>, ViewMixinOptions {
|
||||
> extends Backbone.ViewOptions<TModel>, ViewMixinOptions {
|
||||
/**
|
||||
* Specify a child view to use.
|
||||
*/
|
||||
|
||||
@@ -70,8 +70,8 @@ namespace InitializingWithOptions {
|
||||
});
|
||||
|
||||
var testCollection6 = new TestCollection([
|
||||
<TestModel>{},
|
||||
<TestModel>{},
|
||||
{} as TestModel,
|
||||
{} as TestModel,
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
Vendored
+12
-1
@@ -71,7 +71,18 @@ declare module "backbone" {
|
||||
stopReplying(commandName?: string, callback?: (...args: any[]) => any, context?: any): Requests;
|
||||
}
|
||||
|
||||
class Channel extends Backbone.Events implements Commands, Requests {
|
||||
class Channel implements Commands, Requests, Backbone.Events {
|
||||
on(eventName: string, callback?: (...args: any[]) => void, context?: any): any;
|
||||
on(eventMap: EventsHash): any;
|
||||
on(eventName: any, callback?: any, context?: any): any;
|
||||
off(eventName?: string, callback?: (...args: any[]) => void, context?: any): any;
|
||||
trigger(eventName: string, ...args: any[]): any;
|
||||
bind(eventName: string, callback: (...args: any[]) => void, context?: any): any;
|
||||
unbind(eventName?: string, callback?: (...args: any[]) => void, context?: any): any;
|
||||
once(events: string, callback: (...args: any[]) => void, context?: any): any;
|
||||
listenTo(object: any, events: string, callback: (...args: any[]) => void): any;
|
||||
listenToOnce(object: any, events: string, callback: (...args: any[]) => void): any;
|
||||
stopListening(object?: any, events?: string, callback?: (...args: any[]) => void): any;
|
||||
channelName: string;
|
||||
reset(): Channel;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
function test_events() {
|
||||
|
||||
var object = new Backbone.Events();
|
||||
var object = Backbone.Events;
|
||||
object.on("alert", (eventName: string) => alert("Triggered " + eventName));
|
||||
|
||||
object.trigger("alert", "an event");
|
||||
|
||||
Vendored
+45
-13
@@ -3,6 +3,7 @@
|
||||
// Definitions by: Boris Yankov <https://github.com/borisyankov>
|
||||
// Natan Vivo <https://github.com/nvivo>
|
||||
// kenjiru <https://github.com/kenjiru>
|
||||
// jjoekoullas <https://github.com/jjoekoullas>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
@@ -94,21 +95,34 @@ declare namespace Backbone {
|
||||
[selector: string]: string | {(eventObject: JQueryEventObject): void};
|
||||
}
|
||||
|
||||
class Events {
|
||||
on(eventName: string, callback?: Function, context?: any): any;
|
||||
export const Events: Events;
|
||||
interface Events {
|
||||
on(eventName: string, callback?: (...args: any[]) => void, context?: any): any;
|
||||
on(eventMap: EventsHash): any;
|
||||
off(eventName?: string, callback?: Function, context?: any): any;
|
||||
off(eventName?: string, callback?: (...args: any[]) => void, context?: any): any;
|
||||
trigger(eventName: string, ...args: any[]): any;
|
||||
bind(eventName: string, callback: Function, context?: any): any;
|
||||
unbind(eventName?: string, callback?: Function, context?: any): any;
|
||||
bind(eventName: string, callback: (...args: any[]) => void, context?: any): any;
|
||||
unbind(eventName?: string, callback?: (...args: any[]) => void, context?: any): any;
|
||||
|
||||
once(events: string, callback: Function, context?: any): any;
|
||||
listenTo(object: any, events: string, callback: Function): any;
|
||||
listenToOnce(object: any, events: string, callback: Function): any;
|
||||
stopListening(object?: any, events?: string, callback?: Function): any;
|
||||
once(events: string, callback: (...args: any[]) => void, context?: any): any;
|
||||
listenTo(object: any, events: string, callback: (...args: any[]) => void): any;
|
||||
listenToOnce(object: any, events: string, callback: (...args: any[]) => void): any;
|
||||
stopListening(object?: any, events?: string, callback?: (...args: any[]) => void): any;
|
||||
}
|
||||
|
||||
class ModelBase extends Events {
|
||||
class ModelBase implements Events {
|
||||
on(eventName: string, callback?: Function, context?: any): any;
|
||||
on(eventMap: EventsHash): any;
|
||||
on(eventName: any, callback?: any, context?: any): any
|
||||
off(eventName?: string, callback?: Function, context?: any): any
|
||||
trigger(eventName: string, ...args: any[]): any
|
||||
bind(eventName: string, callback: Function, context?: any): any
|
||||
unbind(eventName?: string, callback?: Function, context?: any): any
|
||||
once(events: string, callback: Function, context?: any): any
|
||||
listenTo(object: any, events: string, callback: Function):any
|
||||
listenToOnce(object: any, events: string, callback: Function): any
|
||||
stopListening(object?: any, events?: string, callback?: Function): any
|
||||
|
||||
parse(response: any, options?: any): any;
|
||||
toJSON(options?: any): any;
|
||||
sync(...arg: any[]): JQueryXHR;
|
||||
@@ -353,7 +367,7 @@ declare namespace Backbone {
|
||||
without(...values: TModel[]): TModel[];
|
||||
}
|
||||
|
||||
class Router extends Events {
|
||||
class Router extends EventSignatures {
|
||||
|
||||
/**
|
||||
* Do not use, prefer TypeScript's extend functionality.
|
||||
@@ -382,7 +396,7 @@ declare namespace Backbone {
|
||||
|
||||
var history: History;
|
||||
|
||||
class History extends Events {
|
||||
class History extends EventSignatures {
|
||||
|
||||
handlers: any[];
|
||||
interval: number;
|
||||
@@ -419,7 +433,7 @@ declare namespace Backbone {
|
||||
attributes?: {[id: string]: any};
|
||||
}
|
||||
|
||||
class View<TModel extends Model> extends Events {
|
||||
class View<TModel extends Model> extends EventSignatures {
|
||||
|
||||
/**
|
||||
* Do not use, prefer TypeScript's extend functionality.
|
||||
@@ -471,3 +485,21 @@ declare namespace Backbone {
|
||||
function noConflict(): typeof Backbone;
|
||||
var $: JQueryStatic;
|
||||
}
|
||||
|
||||
/**
|
||||
* This is not for external use and is only here as a convenient way to
|
||||
* specify signatures for internal implementers of Backbone.Events
|
||||
*/
|
||||
declare abstract class EventSignatures implements Backbone.Events {
|
||||
on(eventName: string, callback?: (...args: any[]) => void, context?: any): any;
|
||||
on(eventMap: Backbone.EventsHash): any;
|
||||
off(eventName?: string, callback?: (...args: any[]) => void, context?: any): any;
|
||||
trigger(eventName: string, ...args: any[]): any;
|
||||
bind(eventName: string, callback: (...args: any[]) => void, context?: any): any;
|
||||
unbind(eventName?: string, callback?: (...args: any[]) => void, context?: any): any;
|
||||
|
||||
once(events: string, callback: (...args: any[]) => void, context?: any): any;
|
||||
listenTo(object: any, events: string, callback: (...args: any[]) => void): any;
|
||||
listenToOnce(object: any, events: string, callback: (...args: any[]) => void): any;
|
||||
stopListening(object?: any, events?: string, callback?: (...args: any[]) => void): any;
|
||||
}
|
||||
@@ -17,6 +17,7 @@
|
||||
"max-line-length": false,
|
||||
"member-access": false,
|
||||
"new-parens": false,
|
||||
"no-angle-bracket-type-assertion": false,
|
||||
"no-any-union": false,
|
||||
"no-boolean-literal-compare": false,
|
||||
"no-conditional-assignment": false,
|
||||
|
||||
@@ -120,7 +120,7 @@ function CommonMethodsInEventStreamsAndProperties() {
|
||||
Bacon.fromArray([1, 2, 3]).withStateMachine(0, (sum, event) => {
|
||||
if (event.hasValue()) {
|
||||
// had to cast to `number` because event:Bacon.Next<number>|Bacon.Error<{}>
|
||||
return [sum + <number>event.value(), []];
|
||||
return [sum + (event.value() as number), []];
|
||||
}
|
||||
else if (event.isEnd()) {
|
||||
return [undefined, [new Bacon.Next(sum), event]];
|
||||
@@ -140,8 +140,8 @@ function CommonMethodsInEventStreamsAndProperties() {
|
||||
|
||||
{
|
||||
// This is handy for keeping track whether we are currently awaiting an AJAX response:
|
||||
var ajaxRequest = <Bacon.Observable<Error, JQueryXHR>>{},
|
||||
ajaxResponse = <Bacon.Observable<Error, JQueryXHR>>{},
|
||||
var ajaxRequest = {} as Bacon.Observable<Error, JQueryXHR>,
|
||||
ajaxResponse = {} as Bacon.Observable<Error, JQueryXHR>,
|
||||
showAjaxIndicator = ajaxRequest.awaiting(ajaxResponse);
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Vendored
+4758
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"dom",
|
||||
"esnext"
|
||||
],
|
||||
"strictFunctionTypes": true,
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"baidu-app-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"no-console": false,
|
||||
"semicolon": true
|
||||
}
|
||||
}
|
||||
@@ -16,7 +16,7 @@ async function run() {
|
||||
clientSecret: '',
|
||||
scope(request) {
|
||||
const scopes = ['public_profile', 'email'];
|
||||
if ((<RequestQuery> request.query).wantsSharePermission) {
|
||||
if ((request.query as RequestQuery).wantsSharePermission) {
|
||||
scopes.push('publish_actions');
|
||||
}
|
||||
return scopes;
|
||||
|
||||
@@ -2,24 +2,32 @@ import Database = require('better-sqlite3');
|
||||
|
||||
const integer = Database.Integer(1);
|
||||
const err = new Database.SqliteError('ok', 'ok');
|
||||
const result: Database.RunResult = { changes: 1, lastInsertRowid: 1 };
|
||||
const options: Database.Options = { fileMustExist: true, memory: true, readonly: true };
|
||||
const registrationOptions: Database.RegistrationOptions = {
|
||||
deterministic: true,
|
||||
name: '',
|
||||
safeIntegers: true,
|
||||
varargs: true
|
||||
};
|
||||
|
||||
let db = Database('.');
|
||||
db = new Database('.', {memory: true});
|
||||
db = new Database('.', { memory: true });
|
||||
db.exec('CREATE TABLE test (id INTEGER PRIMARY KEY NOT NULL, name TEXT NOT NULL);');
|
||||
db.exec('INSERT INTO test(name) VALUES("name");');
|
||||
db.pragma('data_version', true);
|
||||
db.checkpoint();
|
||||
db.checkpoint('main');
|
||||
db.register(() => {});
|
||||
db.register({name: 'noop', deterministic: true, varargs: true}, () => {});
|
||||
db.register(() => { });
|
||||
db.register({ name: 'noop', deterministic: true, varargs: true }, () => { });
|
||||
db.defaultSafeIntegers();
|
||||
db.defaultSafeIntegers(true);
|
||||
|
||||
const stmt = db.prepare('SELECT * FROM test WHERE name == ?;');
|
||||
stmt.get(['name']);
|
||||
stmt.all({name: 'name'});
|
||||
stmt.each('name', (row: {name: string}) => {});
|
||||
stmt.each((row: {name: string}) => {});
|
||||
stmt.all({ name: 'name' });
|
||||
stmt.each('name', (row: { name: string }) => { });
|
||||
stmt.each((row: { name: string }) => { });
|
||||
stmt.pluck();
|
||||
stmt.pluck(true);
|
||||
stmt.bind('name');
|
||||
|
||||
Vendored
+68
-62
@@ -1,88 +1,94 @@
|
||||
// Type definitions for better-sqlite3 3.1
|
||||
// Type definitions for better-sqlite3 5.0
|
||||
// Project: http://github.com/JoshuaWise/better-sqlite3
|
||||
// Definitions by: Ben Davies <https://github.com/Morfent>
|
||||
// Mathew Rumsey <https://github.com/matrumz>
|
||||
// Santiago Aguilar <https://github.com/sant123>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
import Integer = require('integer');
|
||||
|
||||
interface RunResult {
|
||||
changes: number;
|
||||
lastInsertROWID: Integer.IntLike;
|
||||
}
|
||||
import Integer = require("integer");
|
||||
|
||||
declare class Statement {
|
||||
database: Database;
|
||||
source: string;
|
||||
returnsData: boolean;
|
||||
constructor(db: Database, sources: string[]);
|
||||
database: Database;
|
||||
source: string;
|
||||
returnsData: boolean;
|
||||
constructor(db: Database, sources: string[]);
|
||||
|
||||
run(...params: any[]): RunResult;
|
||||
get(...params: any[]): any;
|
||||
all(...params: any[]): any[];
|
||||
each(params: any, cb: (row: any) => void): void;
|
||||
each(cb: (row: any) => void): void;
|
||||
each(...params: any[]): void;
|
||||
pluck(toggleState?: boolean): this;
|
||||
bind(...params: any[]): this;
|
||||
safeIntegers(toggleState?: boolean): this;
|
||||
run(...params: any[]): Database.RunResult;
|
||||
get(...params: any[]): any;
|
||||
all(...params: any[]): any[];
|
||||
each(params: any, cb: (row: any) => void): void;
|
||||
each(cb: (row: any) => void): void;
|
||||
each(...params: any[]): void;
|
||||
pluck(toggleState?: boolean): this;
|
||||
bind(...params: any[]): this;
|
||||
safeIntegers(toggleState?: boolean): this;
|
||||
}
|
||||
|
||||
declare class Transaction {
|
||||
database: Database;
|
||||
source: string;
|
||||
constructor(db: Database, sources: string[]);
|
||||
database: Database;
|
||||
source: string;
|
||||
constructor(db: Database, sources: string[]);
|
||||
|
||||
run(...params: any[]): RunResult;
|
||||
bind(...params: any[]): this;
|
||||
safeIntegers(toggleState?: boolean): this;
|
||||
}
|
||||
|
||||
interface DatabaseOptions {
|
||||
memory?: boolean;
|
||||
readonly?: boolean;
|
||||
fileMustExist?: boolean;
|
||||
}
|
||||
|
||||
interface RegistrationOptions {
|
||||
name?: string;
|
||||
varargs?: boolean;
|
||||
deterministic?: boolean;
|
||||
safeIntegers?: boolean;
|
||||
run(...params: any[]): Database.RunResult;
|
||||
bind(...params: any[]): this;
|
||||
safeIntegers(toggleState?: boolean): this;
|
||||
}
|
||||
|
||||
interface Database {
|
||||
memory: boolean;
|
||||
readonly: boolean;
|
||||
name: string;
|
||||
open: boolean;
|
||||
inTransaction: boolean;
|
||||
memory: boolean;
|
||||
readonly: boolean;
|
||||
name: string;
|
||||
open: boolean;
|
||||
inTransaction: boolean;
|
||||
|
||||
prepare(source: string): Statement;
|
||||
transaction(sources: string[]): Transaction;
|
||||
exec(source: string): this;
|
||||
pragma(source: string, simplify?: boolean): any;
|
||||
checkpoint(databaseName?: string): this;
|
||||
register(cb: (...params: any[]) => any): this;
|
||||
register(options: RegistrationOptions, cb: (...params: any[]) => any): this;
|
||||
close(): this;
|
||||
defaultSafeIntegers(toggleState?: boolean): this;
|
||||
prepare(source: string): Statement;
|
||||
transaction(sources: string[]): Transaction;
|
||||
exec(source: string): this;
|
||||
pragma(source: string, simplify?: boolean): any;
|
||||
checkpoint(databaseName?: string): this;
|
||||
register(cb: (...params: any[]) => any): this;
|
||||
register(
|
||||
options: Database.RegistrationOptions,
|
||||
cb: (...params: any[]) => any
|
||||
): this;
|
||||
close(): this;
|
||||
defaultSafeIntegers(toggleState?: boolean): this;
|
||||
}
|
||||
|
||||
declare class SqliteError implements Error {
|
||||
name: string;
|
||||
message: string;
|
||||
code: string;
|
||||
constructor(message: string, code: string);
|
||||
name: string;
|
||||
message: string;
|
||||
code: string;
|
||||
constructor(message: string, code: string);
|
||||
}
|
||||
|
||||
interface DatabaseConstructor {
|
||||
new(filename: string, options?: DatabaseOptions): Database;
|
||||
(filename: string, options?: DatabaseOptions): Database;
|
||||
prototype: Database;
|
||||
new (filename: string, options?: Database.Options): Database;
|
||||
(filename: string, options?: Database.Options): Database;
|
||||
prototype: Database;
|
||||
|
||||
Integer: typeof Integer;
|
||||
SqliteError: typeof SqliteError;
|
||||
Integer: typeof Integer;
|
||||
SqliteError: typeof SqliteError;
|
||||
}
|
||||
|
||||
declare namespace Database {
|
||||
interface RunResult {
|
||||
changes: number;
|
||||
lastInsertRowid: Integer.IntLike;
|
||||
}
|
||||
|
||||
interface Options {
|
||||
memory?: boolean;
|
||||
readonly?: boolean;
|
||||
fileMustExist?: boolean;
|
||||
}
|
||||
|
||||
interface RegistrationOptions {
|
||||
name?: string;
|
||||
varargs?: boolean;
|
||||
deterministic?: boolean;
|
||||
safeIntegers?: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
declare const Database: DatabaseConstructor;
|
||||
|
||||
Vendored
+1
-1
@@ -17,7 +17,7 @@ export const wordlists: {
|
||||
spanish: string[];
|
||||
};
|
||||
|
||||
export function entropyToMnemonic(entropyHex: string, wordlist?: string[]): string;
|
||||
export function entropyToMnemonic(entropyHex: Buffer | string, wordlist?: string[]): string;
|
||||
|
||||
export function generateMnemonic(strength?: number, rng?: (size: number) => Buffer, wordlist?: string[]): string;
|
||||
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
'use strict';
|
||||
|
||||
import xor = require('bitwise-xor');
|
||||
|
||||
"use strict";
|
||||
let b: Buffer;
|
||||
|
||||
import xor = require("bitwise-xor");
|
||||
|
||||
var b: Buffer;
|
||||
|
||||
b = xor("a", "b");
|
||||
b = xor(new Buffer("a"), new Buffer("b"));
|
||||
b = xor('a', 'b');
|
||||
b = xor(new Buffer('a'), new Buffer('b'));
|
||||
|
||||
Vendored
+3
-4
@@ -1,15 +1,14 @@
|
||||
// Type definitions for bitwise-xor 0.0.0
|
||||
// Type definitions for bitwise-xor 0.0
|
||||
// Project: https://github.com/czzarr/node-bitwise-xor
|
||||
// Definitions by: Rogier Schouten <https://github.com/rogierschouten>
|
||||
// BendingBender <https://github.com/BendingBender>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
|
||||
/**
|
||||
* Bitwise XOR between two Buffers or Strings, returns a Buffer
|
||||
*/
|
||||
declare function xor(b1: Buffer, b2: Buffer): Buffer;
|
||||
declare function xor(s1: string, s2: string): Buffer;
|
||||
declare function xor(a: Buffer | string, b: Buffer | string): Buffer;
|
||||
|
||||
export = xor;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
@@ -20,4 +20,4 @@
|
||||
"index.d.ts",
|
||||
"bitwise-xor-tests.ts"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,79 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"adjacent-overload-signatures": false,
|
||||
"array-type": false,
|
||||
"arrow-return-shorthand": false,
|
||||
"ban-types": false,
|
||||
"callable-types": false,
|
||||
"comment-format": false,
|
||||
"dt-header": false,
|
||||
"eofline": false,
|
||||
"export-just-namespace": false,
|
||||
"import-spacing": false,
|
||||
"interface-name": false,
|
||||
"interface-over-type-literal": false,
|
||||
"jsdoc-format": false,
|
||||
"max-line-length": false,
|
||||
"member-access": false,
|
||||
"new-parens": false,
|
||||
"no-any-union": false,
|
||||
"no-boolean-literal-compare": false,
|
||||
"no-conditional-assignment": false,
|
||||
"no-consecutive-blank-lines": false,
|
||||
"no-construct": false,
|
||||
"no-declare-current-package": false,
|
||||
"no-duplicate-imports": false,
|
||||
"no-duplicate-variable": false,
|
||||
"no-empty-interface": false,
|
||||
"no-for-in-array": false,
|
||||
"no-inferrable-types": false,
|
||||
"no-internal-module": false,
|
||||
"no-irregular-whitespace": false,
|
||||
"no-mergeable-namespace": false,
|
||||
"no-misused-new": false,
|
||||
"no-namespace": false,
|
||||
"no-object-literal-type-assertion": false,
|
||||
"no-padding": false,
|
||||
"no-redundant-jsdoc": false,
|
||||
"no-redundant-jsdoc-2": false,
|
||||
"no-redundant-undefined": false,
|
||||
"no-reference-import": false,
|
||||
"no-relative-import-in-test": false,
|
||||
"no-self-import": false,
|
||||
"no-single-declare-module": false,
|
||||
"no-string-throw": false,
|
||||
"no-unnecessary-callback-wrapper": false,
|
||||
"no-unnecessary-class": false,
|
||||
"no-unnecessary-generics": false,
|
||||
"no-unnecessary-qualifier": false,
|
||||
"no-unnecessary-type-assertion": false,
|
||||
"no-useless-files": false,
|
||||
"no-var-keyword": false,
|
||||
"no-var-requires": false,
|
||||
"no-void-expression": false,
|
||||
"no-trailing-whitespace": false,
|
||||
"object-literal-key-quotes": false,
|
||||
"object-literal-shorthand": false,
|
||||
"one-line": false,
|
||||
"one-variable-per-declaration": false,
|
||||
"only-arrow-functions": false,
|
||||
"prefer-conditional-expression": false,
|
||||
"prefer-const": false,
|
||||
"prefer-declare-function": false,
|
||||
"prefer-for-of": false,
|
||||
"prefer-method-signature": false,
|
||||
"prefer-template": false,
|
||||
"radix": false,
|
||||
"semicolon": false,
|
||||
"space-before-function-paren": false,
|
||||
"space-within-parens": false,
|
||||
"strict-export-declare-modifiers": false,
|
||||
"trim-file": false,
|
||||
"triple-equals": false,
|
||||
"typedef-whitespace": false,
|
||||
"unified-signatures": false,
|
||||
"void-return": false,
|
||||
"whitespace": false
|
||||
}
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
"max-line-length": false,
|
||||
"member-access": false,
|
||||
"new-parens": false,
|
||||
"no-angle-bracket-type-assertion": false,
|
||||
"no-any-union": false,
|
||||
"no-boolean-literal-compare": false,
|
||||
"no-conditional-assignment": false,
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"no-angle-bracket-type-assertion": false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
import 'bootstrap-toggle';
|
||||
|
||||
const $elem = $("#toggle");
|
||||
|
||||
// Test Initialise Cases
|
||||
$elem.bootstrapToggle();
|
||||
|
||||
$elem.bootstrapToggle({});
|
||||
|
||||
$elem.bootstrapToggle({
|
||||
// Defaults from source project
|
||||
on: 'On',
|
||||
off: 'Off',
|
||||
onstyle: 'primary',
|
||||
offstyle: 'default',
|
||||
size: 'normal',
|
||||
style: '',
|
||||
width: null,
|
||||
height: null
|
||||
});
|
||||
|
||||
$elem.bootstrapToggle({
|
||||
width: 100,
|
||||
height: 100
|
||||
});
|
||||
|
||||
$elem.bootstrapToggle({
|
||||
width: "100%",
|
||||
height: "100%"
|
||||
});
|
||||
|
||||
// Methods
|
||||
$elem.bootstrapToggle("destroy");
|
||||
$elem.bootstrapToggle("on");
|
||||
$elem.bootstrapToggle("off");
|
||||
$elem.bootstrapToggle("toggle");
|
||||
$elem.bootstrapToggle("enable");
|
||||
$elem.bootstrapToggle("disable");
|
||||
Vendored
+23
@@ -0,0 +1,23 @@
|
||||
// Type definitions for bootstrap-toggle 2.2
|
||||
// Project: https://github.com/minhur/bootstrap-toggle
|
||||
// Definitions by: Mitchell Grice <https://github.com/gricey432>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
/// <reference types="jquery"/>
|
||||
|
||||
interface BootstrapToggleOptions {
|
||||
on?: string;
|
||||
off?: string;
|
||||
size?: string;
|
||||
onstyle?: string;
|
||||
offstyle?: string;
|
||||
style?: string;
|
||||
width?: number | string | null;
|
||||
height?: number | string | null;
|
||||
}
|
||||
|
||||
interface JQuery {
|
||||
bootstrapToggle(options?: BootstrapToggleOptions): JQuery;
|
||||
bootstrapToggle(command: "destroy" | "on" | "off" | "toggle" | "enable" | "disable"): JQuery;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"bootstrap-toggle-tests.ts"
|
||||
]
|
||||
}
|
||||
Vendored
+21
-15
@@ -2,6 +2,7 @@
|
||||
// Project: https://github.com/braintree/braintree-web
|
||||
// Definitions by: Guy Shahine <https://github.com/chlela>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.1
|
||||
|
||||
/**
|
||||
* @module braintree-web/american-express
|
||||
@@ -359,7 +360,8 @@ declare namespace braintree {
|
||||
* });
|
||||
* @static
|
||||
*/
|
||||
create: (options: { authorization: string }, callback: callback) => void;
|
||||
create(options: { authorization: string }): Promise<Client>;
|
||||
create(options: { authorization: string }, callback: callback): void;
|
||||
|
||||
/**
|
||||
* @description The current version of the SDK, i.e. `3.0.2`.
|
||||
@@ -439,7 +441,8 @@ declare namespace braintree {
|
||||
* @param {callback} callback The second argument, `data`, is the {@link DataCollector} instance.
|
||||
* @returns {void}
|
||||
*/
|
||||
create: (options: { client: Client, kount: boolean, paypal: boolean }, callback: callback) => void;
|
||||
create(options: { client: Client, kount: boolean, paypal: boolean }): Promise<DataCollector>;
|
||||
create(options: { client: Client, kount: boolean, paypal: boolean }, callback: callback): void;
|
||||
|
||||
/**
|
||||
* @description The current version of the SDK, i.e. `3.0.2`.
|
||||
@@ -591,18 +594,15 @@ declare namespace braintree {
|
||||
* @property {?HostedFields~hostedFieldsFieldData} fields.expirationYear {@link HostedFields~hostedFieldsFieldData|hostedFieldsFieldData} for the expiration year field, if it is present.
|
||||
* @property {?HostedFields~hostedFieldsFieldData} fields.postalCode {@link HostedFields~hostedFieldsFieldData|hostedFieldsFieldData} for the postal code field, if it is present.
|
||||
*/
|
||||
interface HostedFieldsFieldDataFields {
|
||||
number: HostedFieldsHostedFieldsFieldData;
|
||||
cvv: HostedFieldsHostedFieldsFieldData;
|
||||
expirationDate: HostedFieldsHostedFieldsFieldData;
|
||||
expirationMonth: HostedFieldsHostedFieldsFieldData;
|
||||
expirationYear: HostedFieldsHostedFieldsFieldData;
|
||||
postalCode: HostedFieldsHostedFieldsFieldData;
|
||||
}
|
||||
type HostedFieldsHostedFieldsFieldName = 'number' | 'cvv' | 'expirationDate' | 'expirationMonth' | 'expirationYear' | 'postalCode';
|
||||
|
||||
type HostedFieldsFieldDataFields = {
|
||||
[key in HostedFieldsHostedFieldsFieldName]: HostedFieldsHostedFieldsFieldData;
|
||||
};
|
||||
|
||||
interface HostedFieldsStateObject {
|
||||
cards: HostedFieldsHostedFieldsCard[];
|
||||
emittedBy: string;
|
||||
emittedBy: HostedFieldsHostedFieldsFieldName;
|
||||
fields: HostedFieldsFieldDataFields;
|
||||
}
|
||||
|
||||
@@ -666,7 +666,8 @@ declare namespace braintree {
|
||||
* }
|
||||
* }, callback);
|
||||
*/
|
||||
create: (options: { client: Client, fields: HostedFieldFieldOptions, styles: any }, callback: callback) => void;
|
||||
create(options: { client: Client, fields: HostedFieldFieldOptions, styles: any }): Promise<HostedFields>;
|
||||
create(options: { client: Client, fields: HostedFieldFieldOptions, styles: any }, callback: callback): void;
|
||||
|
||||
|
||||
/**
|
||||
@@ -726,7 +727,7 @@ declare namespace braintree {
|
||||
* });
|
||||
* @returns {void}
|
||||
*/
|
||||
on(event: string, handler: ((event: any) => any)): void;
|
||||
on(event: string, handler: ((event: HostedFieldsStateObject) => void)): void;
|
||||
|
||||
/**
|
||||
* Cleanly tear down anything set up by {@link module:braintree-web/hosted-fields.create|create}
|
||||
@@ -785,7 +786,9 @@ declare namespace braintree {
|
||||
* });
|
||||
* @returns {void}
|
||||
*/
|
||||
tokenize(options?: { vault: boolean }, callback?: callback): void;
|
||||
tokenize(options?: { vault?: boolean, cardholderName?: string, billingAddress?: any }): Promise<HostedFieldsTokenizePayload>;
|
||||
tokenize(options: { vault?: boolean, cardholderName?: string, billingAddress?: any }, callback: callback): void;
|
||||
tokenize(callback: callback): void;
|
||||
|
||||
/**
|
||||
* Add a class to a {@link module:braintree-web/hosted-fields~field field}. Useful for updating field styles when events occur elsewhere in your checkout.
|
||||
@@ -1138,7 +1141,8 @@ declare namespace braintree {
|
||||
* client: client
|
||||
* }, callback);
|
||||
*/
|
||||
create: (options: { client: Client }, callback: callback) => void;
|
||||
create(options: { client: Client }): Promise<ThreeDSecure>;
|
||||
create(options: { client: Client }, callback: callback): void;
|
||||
|
||||
/**
|
||||
* @description The current version of the SDK, i.e. `3.0.2`.
|
||||
@@ -1207,6 +1211,7 @@ declare namespace braintree {
|
||||
* }
|
||||
* });
|
||||
*/
|
||||
verifyCard(options: { nonce: string, amount: number, addFrame: (err?: BraintreeError, iframe?: HTMLIFrameElement) => void, removeFrame?: () => void }): Promise<ThreeDSecureVerifyPayload>;
|
||||
verifyCard(options: { nonce: string, amount: number, addFrame: (err?: BraintreeError, iframe?: HTMLIFrameElement) => void, removeFrame: () => void }, callback: callback): void;
|
||||
|
||||
/**
|
||||
@@ -1751,3 +1756,4 @@ declare namespace braintree {
|
||||
|
||||
export = braintree;
|
||||
export as namespace braintree;
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ let clientToken: string = "eyJ2ZXJzaW9uIjoyLCJhdXRob3JpemF0aW9uRmluZ2VycHJpbnQiO
|
||||
|
||||
braintree.client.create({
|
||||
authorization: clientToken
|
||||
}, function (error: braintree.BraintreeError, clientInstance: any) {
|
||||
}, function (error: braintree.BraintreeError, clientInstance: braintree.Client) {
|
||||
|
||||
var form: HTMLFormElement = document.getElementById('my-form-id') as HTMLFormElement;
|
||||
var data: { creditCard: braintree.CreditCardInfo } = {
|
||||
@@ -396,7 +396,7 @@ let submitNonceToServer: (nonce: string) => void;
|
||||
|
||||
braintree.threeDSecure.verifyCard({
|
||||
nonce: existingNonce,
|
||||
amount: 123.45,
|
||||
amount: 123.45, // $ExpectType number
|
||||
addFrame: function (err, iframe) {
|
||||
// Set up your UI and add the iframe.
|
||||
let my3DSContainer = document.createElement('div');
|
||||
@@ -437,4 +437,4 @@ braintree.threeDSecure.cancelVerifyCard(function (err: braintree.BraintreeError,
|
||||
verifyPayload.nonce; // The nonce returned from the 3ds lookup call
|
||||
verifyPayload.liabilityShifted; // boolean
|
||||
verifyPayload.liabilityShiftPossible; // boolean
|
||||
});
|
||||
});
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user