mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-06 07:47:04 +00:00
+555
-179
File diff suppressed because it is too large
Load Diff
@@ -255,12 +255,30 @@ Here are the [currently requested definitions](https://github.com/DefinitelyType
|
||||
|
||||
If types are part of a web standard, they should be contributed to [TSJS-lib-generator](https://github.com/Microsoft/TSJS-lib-generator) so that they can become part of the default `lib.dom.d.ts`.
|
||||
|
||||
#### Should I add an empty namespace to a package that doesn't export a module to use ES6 style imports?
|
||||
|
||||
Some packages, like [chai-http](https://github.com/chaijs/chai-http), export a function.
|
||||
|
||||
Importing this module with an ES6 style import in the form `import * as foo from "foo";` leads to the error:
|
||||
|
||||
> error TS2497: Module 'foo' resolves to a non-module entity and cannot be imported using this construct
|
||||
|
||||
This error can be suppressed by merging the function declaration with an empty namespace of the same name, but this practice is discouraged.
|
||||
This is a commonly cited [Stack Overflow answer](https://stackoverflow.com/questions/39415661/what-does-resolves-to-a-non-module-entity-and-cannot-be-imported-using-this) regarding this matter.
|
||||
|
||||
It is more appropriate to import the module using the `import foo = require("foo");` syntax.
|
||||
Nevertheless, if you want to use a default import like `import foo from "foo";` you have two options:
|
||||
- you can use the [`--allowSyntheticDefaultImports` compiler option](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-1-8.html#support-for-default-import-interop-with-systemjs) if your module runtime supports an interop scheme for non-ECMAScript modules, i.e. if default imports work in your environment (e.g. Webpack, SystemJS, esm).
|
||||
- you can use the [`--esModuleInterop` compiler option](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-7.html#support-for-import-d-from-cjs-form-commonjs-modules-with---esmoduleinterop) if you want TypeScript to take care of non-ECMAScript interop (since Typescript 2.7).
|
||||
|
||||
#### A package uses `export =`, but I prefer to use default imports. Can I change `export =` to `export default`?
|
||||
|
||||
If you are using TypeScript 2.7 or later, use `--esModuleInterop` in your project.
|
||||
Otherwise, if default imports work in your environment (e.g. Webpack, SystemJS, esm), consider turning on the [`--allowSyntheticDefaultImports`](http://www.typescriptlang.org/docs/handbook/compiler-options.html) compiler option.
|
||||
Like in the previous question, refer to using either the [`--allowSyntheticDefaultImports`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-1-8.html#support-for-default-import-interop-with-systemjs)
|
||||
or [`--esModuleInterop`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-7.html#support-for-import-d-from-cjs-form-commonjs-modules-with---esmoduleinterop)
|
||||
compiler options.
|
||||
|
||||
Do not change the type definition if it is accurate.
|
||||
For an NPM package, `export =` is accurate if `node -p 'require("foo")'` is the export, and `export default` is accurate if `node -p 'require("foo").default'` is the export.
|
||||
For an NPM package, `export =` is accurate if `node -p 'require("foo")'` works to import a module, and `export default` is accurate if `node -p 'require("foo").default'` works to import a module.
|
||||
|
||||
#### I want to use features from TypeScript 2.1 or above.
|
||||
|
||||
@@ -268,8 +286,9 @@ Then you will have to add a comment to the last line of your definition header (
|
||||
|
||||
#### I want to use features from TypeScript 3.1 or above.
|
||||
|
||||
You will need to use the `typesVersions` feature of TypeScript 3.1 and above. You can find a detailed explanation
|
||||
of this feature in the [official TypeScript documentation](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-1.html#version-selection-with-typesversions).
|
||||
You can use the same `// TypeScript Version: 3.1` comment as above.
|
||||
However, if your project needs to maintain types that are compatible with 3.1 and above *at the same time as* types that are compatible with 3.0 or below, you will need to use the `typesVersions` feature, which is available in TypeScript 3.1 and above.
|
||||
You can find a detailed explanation of this feature in the [official TypeScript documentation](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-1.html#version-selection-with-typesversions).
|
||||
|
||||
Here's a short explanation to get you started:
|
||||
|
||||
@@ -368,19 +387,6 @@ When `dts-gen` is used to scaffold a scoped package, the `paths` property has to
|
||||
|
||||
GitHub doesn't [support](http://stackoverflow.com/questions/5646174/how-to-make-github-follow-directory-history-after-renames) file history for renamed files. Use [`git log --follow`](https://www.git-scm.com/docs/git-log) instead.
|
||||
|
||||
#### Should I add an empty namespace to a package that doesn't export a module to use ES6 style imports?
|
||||
|
||||
Some packages, like [chai-http](https://github.com/chaijs/chai-http), export a function.
|
||||
|
||||
Importing this module with an ES6 style import in the form `import * as foo from "foo";` leads to the error:
|
||||
|
||||
> error TS2497: Module 'foo' resolves to a non-module entity and cannot be imported using this construct
|
||||
|
||||
This error can be suppressed by merging the function declaration with an empty namespace of the same name, but this practice is discouraged.
|
||||
This is a commonly cited [Stack Overflow answer](https://stackoverflow.com/questions/39415661/what-does-resolves-to-a-non-module-entity-and-cannot-be-imported-using-this) regarding this matter.
|
||||
|
||||
It is more appropriate to import the module using the `import foo = require("foo");` syntax, or to use a default import like `import foo from "foo";` if using the `--allowSyntheticDefaultImports` flag if your module runtime supports an interop scheme for non-ECMAScript modules as such.
|
||||
|
||||
## License
|
||||
|
||||
This project is licensed under the MIT license.
|
||||
|
||||
@@ -1728,6 +1728,12 @@
|
||||
"sourceRepoURL": "https://github.com/tgdwyer/WebCola",
|
||||
"asOfVersion": "3.2.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "WebdriverIO",
|
||||
"typingsPackageName": "webdriverio",
|
||||
"sourceRepoURL": "git@github.com:webdriverio/webdriverio.git",
|
||||
"asOfVersion": "5.0.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "webgme",
|
||||
"typingsPackageName": "webgme",
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
// Tests for Amplitude SDK TypeScript definitions
|
||||
|
||||
import amplitude = require('amplitude-js');
|
||||
|
||||
module Amplitude.Tests {
|
||||
|
||||
function all() {
|
||||
|
||||
Vendored
+136
-137
@@ -4,143 +4,142 @@
|
||||
// Dan Manastireanu <https://github.com/danmana>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare module amplitude {
|
||||
export as namespace amplitude;
|
||||
|
||||
type Callback = (responseCode: number, responseBody: string, details?: { reason: string; }) => void;
|
||||
type LogReturn = number | void;
|
||||
type Callback = (responseCode: number, responseBody: string, details?: { reason: string; }) => void;
|
||||
type LogReturn = number | void;
|
||||
|
||||
interface Config {
|
||||
apiEndpoint?: string;
|
||||
batchEvents?: boolean;
|
||||
cookieExpiration?: number;
|
||||
cookieName?: string;
|
||||
userId?: string;
|
||||
deviceId?: string;
|
||||
deviceIdFromUrlParam?: boolean;
|
||||
domain?: string;
|
||||
eventUploadPeriodMillis?: number;
|
||||
eventUploadThreshold?: number;
|
||||
forceHttps?: boolean;
|
||||
includeGclid?: boolean;
|
||||
includeReferrer?: boolean;
|
||||
includeUtm?: boolean;
|
||||
language?: string;
|
||||
logLevel?: 'DISABLE' | 'ERROR' | 'WARN' | 'INFO';
|
||||
optOut?: boolean;
|
||||
platform?: string;
|
||||
saveEvents?: boolean;
|
||||
savedMaxCount?: number;
|
||||
saveParamsReferrerOncePerSession?: boolean;
|
||||
sessionTimeout?: number;
|
||||
trackingOptions?: {
|
||||
city?: boolean;
|
||||
country?: boolean;
|
||||
device_model?: boolean;
|
||||
dma?: boolean;
|
||||
ip_address?: boolean;
|
||||
language?: boolean;
|
||||
os_name?: boolean;
|
||||
os_version?: boolean;
|
||||
platform?: boolean;
|
||||
region?: boolean;
|
||||
version_name?: boolean;
|
||||
},
|
||||
unsentKey?: string;
|
||||
unsentIdentifyKey?: string;
|
||||
uploadBatchSize?: number;
|
||||
}
|
||||
|
||||
export class Identify {
|
||||
set(key: string, value: any): Identify;
|
||||
setOnce(key: string, value: any): Identify;
|
||||
add(key: string, value: number | string): Identify;
|
||||
append(key: string, value: any): Identify;
|
||||
prepend(key: string, value: any): Identify;
|
||||
|
||||
unset(key: string): Identify;
|
||||
}
|
||||
|
||||
export class Revenue {
|
||||
|
||||
setProductId(productId: string): Revenue;
|
||||
setQuantity(quantity: number): Revenue;
|
||||
setPrice(price: number): Revenue;
|
||||
setRevenueType(revenueType: string): Revenue;
|
||||
setEventProperties(eventProperties: any): Revenue;
|
||||
}
|
||||
|
||||
export class AmplitudeClient {
|
||||
|
||||
constructor(instanceName?: string);
|
||||
|
||||
options: Config;
|
||||
|
||||
init(apiKey: string, userId?: string, config?: Config, callback?: (client: AmplitudeClient) => void): void;
|
||||
|
||||
setVersionName(versionName: string): void;
|
||||
|
||||
isNewSession(): boolean;
|
||||
setSessionId(sessionId: number): void;
|
||||
getSessionId(): number;
|
||||
|
||||
setDomain(domain: string): void;
|
||||
setUserId(userId: string): void;
|
||||
|
||||
setDeviceId(id: string): void;
|
||||
regenerateDeviceId(): void;
|
||||
|
||||
identify(identify_obj: Identify, opt_callback?: Callback): void;
|
||||
|
||||
setUserProperties(properties: any): void;
|
||||
setGlobalUserProperties(properties: any): void;
|
||||
clearUserProperties(): void;
|
||||
|
||||
setOptOut(enable: boolean): void;
|
||||
|
||||
setGroup(groupType: string, groupName: string | string[]): void;
|
||||
|
||||
logEvent(event: string, data?: any, callback?: Callback): LogReturn;
|
||||
logEventWithGroups(event: string, data?: any, groups?: any, callback?: Callback): LogReturn;
|
||||
logRevenueV2(revenue_obj: Revenue): LogReturn;
|
||||
logRevenue(pric: number, quantity: number, product: string): LogReturn;
|
||||
logEventWithTimestamp(event: string, data?: any, timestamp?: number, callback?: Callback): LogReturn;
|
||||
}
|
||||
|
||||
// Proxy methods that get executed on the default AmplitudeClient instance (not all client methods are proxied)
|
||||
|
||||
export function init(apiKey: string, userId?: string, options?: Config, callback?: (client: AmplitudeClient) => void): void;
|
||||
|
||||
export function setVersionName(version: string): void;
|
||||
|
||||
export function isNewSession(): boolean;
|
||||
export function getSessionId(): number;
|
||||
|
||||
export function setDomain(domain: string): void;
|
||||
|
||||
export function setUserId(userId: string): void;
|
||||
|
||||
export function setDeviceId(id: string): void;
|
||||
export function regenerateDeviceId(): void;
|
||||
|
||||
export function identify(identify: Identify, callback?: Callback): void;
|
||||
|
||||
export function setUserProperties(properties: any): void;
|
||||
export function setGlobalUserProperties(properties: any): void;
|
||||
export function clearUserProperties(): void;
|
||||
|
||||
export function setOptOut(optOut: boolean): void;
|
||||
|
||||
export function setGroup(groupType: string, groupName: string | string[]): void;
|
||||
|
||||
export function logEvent(event: string, data?: any, callback?: Callback): LogReturn;
|
||||
export function logEventWithGroups(event: string, data?: any, groups?: any, callback?: Callback): LogReturn;
|
||||
export function logRevenueV2(revenue_obj: Revenue): LogReturn;
|
||||
export function logRevenue(pric: number, quantity: number, product: string): LogReturn;
|
||||
export function logEventWithTimestamp(event: string, data?: any, timestamp?: number, callback?: Callback): LogReturn;
|
||||
|
||||
|
||||
|
||||
export function getInstance(instanceName?: string): AmplitudeClient;
|
||||
export const __VERSION__: string;
|
||||
export var options: Config;
|
||||
interface Config {
|
||||
apiEndpoint?: string;
|
||||
batchEvents?: boolean;
|
||||
cookieExpiration?: number;
|
||||
cookieName?: string;
|
||||
userId?: string;
|
||||
deviceId?: string;
|
||||
deviceIdFromUrlParam?: boolean;
|
||||
domain?: string;
|
||||
eventUploadPeriodMillis?: number;
|
||||
eventUploadThreshold?: number;
|
||||
forceHttps?: boolean;
|
||||
includeGclid?: boolean;
|
||||
includeReferrer?: boolean;
|
||||
includeUtm?: boolean;
|
||||
language?: string;
|
||||
logLevel?: 'DISABLE' | 'ERROR' | 'WARN' | 'INFO';
|
||||
optOut?: boolean;
|
||||
platform?: string;
|
||||
saveEvents?: boolean;
|
||||
savedMaxCount?: number;
|
||||
saveParamsReferrerOncePerSession?: boolean;
|
||||
sessionTimeout?: number;
|
||||
trackingOptions?: {
|
||||
city?: boolean;
|
||||
country?: boolean;
|
||||
device_model?: boolean;
|
||||
dma?: boolean;
|
||||
ip_address?: boolean;
|
||||
language?: boolean;
|
||||
os_name?: boolean;
|
||||
os_version?: boolean;
|
||||
platform?: boolean;
|
||||
region?: boolean;
|
||||
version_name?: boolean;
|
||||
},
|
||||
unsentKey?: string;
|
||||
unsentIdentifyKey?: string;
|
||||
uploadBatchSize?: number;
|
||||
}
|
||||
|
||||
export class Identify {
|
||||
set(key: string, value: any): Identify;
|
||||
setOnce(key: string, value: any): Identify;
|
||||
add(key: string, value: number | string): Identify;
|
||||
append(key: string, value: any): Identify;
|
||||
prepend(key: string, value: any): Identify;
|
||||
|
||||
unset(key: string): Identify;
|
||||
}
|
||||
|
||||
export class Revenue {
|
||||
|
||||
setProductId(productId: string): Revenue;
|
||||
setQuantity(quantity: number): Revenue;
|
||||
setPrice(price: number): Revenue;
|
||||
setRevenueType(revenueType: string): Revenue;
|
||||
setEventProperties(eventProperties: any): Revenue;
|
||||
}
|
||||
|
||||
export class AmplitudeClient {
|
||||
|
||||
constructor(instanceName?: string);
|
||||
|
||||
options: Config;
|
||||
|
||||
init(apiKey: string, userId?: string, config?: Config, callback?: (client: AmplitudeClient) => void): void;
|
||||
|
||||
setVersionName(versionName: string): void;
|
||||
|
||||
isNewSession(): boolean;
|
||||
setSessionId(sessionId: number): void;
|
||||
getSessionId(): number;
|
||||
|
||||
setDomain(domain: string): void;
|
||||
setUserId(userId: string): void;
|
||||
|
||||
setDeviceId(id: string): void;
|
||||
regenerateDeviceId(): void;
|
||||
|
||||
identify(identify_obj: Identify, opt_callback?: Callback): void;
|
||||
|
||||
setUserProperties(properties: any): void;
|
||||
setGlobalUserProperties(properties: any): void;
|
||||
clearUserProperties(): void;
|
||||
|
||||
setOptOut(enable: boolean): void;
|
||||
|
||||
setGroup(groupType: string, groupName: string | string[]): void;
|
||||
|
||||
logEvent(event: string, data?: any, callback?: Callback): LogReturn;
|
||||
logEventWithGroups(event: string, data?: any, groups?: any, callback?: Callback): LogReturn;
|
||||
logRevenueV2(revenue_obj: Revenue): LogReturn;
|
||||
logRevenue(pric: number, quantity: number, product: string): LogReturn;
|
||||
logEventWithTimestamp(event: string, data?: any, timestamp?: number, callback?: Callback): LogReturn;
|
||||
}
|
||||
|
||||
// Proxy methods that get executed on the default AmplitudeClient instance (not all client methods are proxied)
|
||||
|
||||
export function init(apiKey: string, userId?: string, options?: Config, callback?: (client: AmplitudeClient) => void): void;
|
||||
|
||||
export function setVersionName(version: string): void;
|
||||
|
||||
export function isNewSession(): boolean;
|
||||
export function getSessionId(): number;
|
||||
|
||||
export function setDomain(domain: string): void;
|
||||
|
||||
export function setUserId(userId: string): void;
|
||||
|
||||
export function setDeviceId(id: string): void;
|
||||
export function regenerateDeviceId(): void;
|
||||
|
||||
export function identify(identify: Identify, callback?: Callback): void;
|
||||
|
||||
export function setUserProperties(properties: any): void;
|
||||
export function setGlobalUserProperties(properties: any): void;
|
||||
export function clearUserProperties(): void;
|
||||
|
||||
export function setOptOut(optOut: boolean): void;
|
||||
|
||||
export function setGroup(groupType: string, groupName: string | string[]): void;
|
||||
|
||||
export function logEvent(event: string, data?: any, callback?: Callback): LogReturn;
|
||||
export function logEventWithGroups(event: string, data?: any, groups?: any, callback?: Callback): LogReturn;
|
||||
export function logRevenueV2(revenue_obj: Revenue): LogReturn;
|
||||
export function logRevenue(pric: number, quantity: number, product: string): LogReturn;
|
||||
export function logEventWithTimestamp(event: string, data?: any, timestamp?: number, callback?: Callback): LogReturn;
|
||||
|
||||
|
||||
|
||||
export function getInstance(instanceName?: string): AmplitudeClient;
|
||||
export const __VERSION__: string;
|
||||
export var options: Config;
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
import { Ber, BerReader, BerWriter } from 'asn1';
|
||||
|
||||
let buf: Buffer = Buffer.alloc(0);
|
||||
let bool = false;
|
||||
let str = '';
|
||||
let num = 0;
|
||||
let numOrNull: number | null = 0;
|
||||
const roStrArray: ReadonlyArray<string> = [str];
|
||||
|
||||
const reader = new BerReader(buf);
|
||||
numOrNull = reader.peek();
|
||||
bool = reader.readBoolean();
|
||||
numOrNull = reader.readByte(bool);
|
||||
num = reader.readEnumeration();
|
||||
num = reader.readInt();
|
||||
num = reader.readLength();
|
||||
num = reader.readLength(num);
|
||||
str = reader.readOID();
|
||||
str = reader.readOID(num);
|
||||
numOrNull = reader.readSequence();
|
||||
numOrNull = reader.readSequence(num);
|
||||
str = reader.readString();
|
||||
str = reader.readString(num);
|
||||
buf = reader.readString(num, bool);
|
||||
num = reader._readTag();
|
||||
num = reader._readTag(num);
|
||||
|
||||
let writer = new BerWriter();
|
||||
writer = new BerWriter({
|
||||
size: num,
|
||||
growthFactor: num,
|
||||
});
|
||||
|
||||
buf = writer.buffer;
|
||||
buf = writer._buf;
|
||||
num = writer._size;
|
||||
num = writer._offset;
|
||||
|
||||
writer.endSequence();
|
||||
writer.startSequence();
|
||||
writer.startSequence(num);
|
||||
writer.writeBoolean(bool);
|
||||
writer.writeBoolean(bool, num);
|
||||
writer.writeBuffer(buf, num);
|
||||
writer.writeByte(num);
|
||||
writer.writeEnumeration(num);
|
||||
writer.writeEnumeration(num, num);
|
||||
writer.writeInt(num);
|
||||
writer.writeInt(num, num);
|
||||
writer.writeLength(num);
|
||||
writer.writeNull();
|
||||
writer.writeOID(str, num);
|
||||
writer.writeString(str);
|
||||
writer.writeString(str, num);
|
||||
writer.writeStringArray(roStrArray);
|
||||
writer._ensure(num);
|
||||
|
||||
num = Ber.BMPString;
|
||||
num = Ber.BitString;
|
||||
num = Ber.Boolean;
|
||||
num = Ber.CharacterString;
|
||||
num = Ber.Constructor;
|
||||
num = Ber.Context;
|
||||
num = Ber.EOC;
|
||||
num = Ber.Enumeration;
|
||||
num = Ber.External;
|
||||
num = Ber.GeneralString;
|
||||
num = Ber.GeneralizedTime;
|
||||
num = Ber.GraphicString;
|
||||
num = Ber.IA5String;
|
||||
num = Ber.Integer;
|
||||
num = Ber.Null;
|
||||
num = Ber.NumericString;
|
||||
num = Ber.OID;
|
||||
num = Ber.ObjectDescriptor;
|
||||
num = Ber.OctetString;
|
||||
num = Ber.PDV;
|
||||
num = Ber.PrintableString;
|
||||
num = Ber.Real;
|
||||
num = Ber.RelativeOID;
|
||||
num = Ber.Sequence;
|
||||
num = Ber.Set;
|
||||
num = Ber.T61String;
|
||||
num = Ber.UTCTime;
|
||||
num = Ber.UniversalString;
|
||||
num = Ber.Utf8String;
|
||||
num = Ber.VideotexString;
|
||||
num = Ber.VisibleString;
|
||||
Vendored
+126
@@ -0,0 +1,126 @@
|
||||
// Type definitions for asn1 0.2
|
||||
// Project: https://github.com/joyent/node-asn1
|
||||
// Definitions by: Jim Geurts <https://github.com/jgeurts>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
/// <reference types="node" />
|
||||
|
||||
export class BerReader {
|
||||
readonly buffer: Buffer;
|
||||
readonly offset: number;
|
||||
readonly length: number;
|
||||
readonly remain: number;
|
||||
readonly _buf: Buffer;
|
||||
_size: number;
|
||||
_offset: number;
|
||||
|
||||
constructor(data: Buffer);
|
||||
|
||||
peek(): number | null;
|
||||
readBoolean(): boolean;
|
||||
readByte(peek: boolean): number | null;
|
||||
readEnumeration(): number;
|
||||
readInt(): number;
|
||||
readLength(offset?: number): number;
|
||||
readOID(tag?: number): string;
|
||||
readSequence(tag?: number): number | null;
|
||||
readString(tag?: number): string;
|
||||
readString(tag: number, retbuf: boolean): Buffer;
|
||||
_readTag(tag?: number): number;
|
||||
}
|
||||
|
||||
export class BerWriter {
|
||||
readonly buffer: Buffer;
|
||||
readonly _buf: Buffer;
|
||||
readonly _size: number;
|
||||
_offset: number;
|
||||
|
||||
constructor(options?: {
|
||||
size: number;
|
||||
growthFactor: number;
|
||||
});
|
||||
|
||||
endSequence(): void;
|
||||
startSequence(tag?: number): void;
|
||||
writeBoolean(b: boolean, tag?: number): void;
|
||||
writeBuffer(buf: Buffer, tag: number): void;
|
||||
writeByte(b: number): void;
|
||||
writeEnumeration(i: number, tag?: number): void;
|
||||
writeInt(i: number, tag?: number): void;
|
||||
writeLength(len: number): void;
|
||||
writeNull(): void;
|
||||
writeOID(s: string, tag: number): void;
|
||||
writeString(s: string, tag?: number): void;
|
||||
writeStringArray(strings: ReadonlyArray<string>): void;
|
||||
_ensure(length: number): void;
|
||||
}
|
||||
|
||||
export namespace Ber {
|
||||
const BMPString: number;
|
||||
const BitString: number;
|
||||
const Boolean: number;
|
||||
const CharacterString: number;
|
||||
const Constructor: number;
|
||||
const Context: number;
|
||||
const EOC: number;
|
||||
const Enumeration: number;
|
||||
const External: number;
|
||||
const GeneralString: number;
|
||||
const GeneralizedTime: number;
|
||||
const GraphicString: number;
|
||||
const IA5String: number;
|
||||
const Integer: number;
|
||||
const Null: number;
|
||||
const NumericString: number;
|
||||
const OID: number;
|
||||
const ObjectDescriptor: number;
|
||||
const OctetString: number;
|
||||
const PDV: number;
|
||||
const PrintableString: number;
|
||||
const Real: number;
|
||||
const RelativeOID: number;
|
||||
const Sequence: number;
|
||||
const Set: number;
|
||||
const T61String: number;
|
||||
const UTCTime: number;
|
||||
const UniversalString: number;
|
||||
const Utf8String: number;
|
||||
const VideotexString: number;
|
||||
const VisibleString: number;
|
||||
}
|
||||
/*
|
||||
declare enum BerType {
|
||||
EOC = 0,
|
||||
Boolean = 1,
|
||||
Integer = 2,
|
||||
BitString = 3,
|
||||
OctetString = 4,
|
||||
Null = 5,
|
||||
OID = 6,
|
||||
ObjectDescriptor = 7,
|
||||
External = 8,
|
||||
Real = 9, // float
|
||||
Enumeration = 10,
|
||||
PDV = 11,
|
||||
Utf8String = 12,
|
||||
RelativeOID = 13,
|
||||
Sequence = 16,
|
||||
Set = 17,
|
||||
NumericString = 18,
|
||||
PrintableString = 19,
|
||||
T61String = 20,
|
||||
VideotexString = 21,
|
||||
IA5String = 22,
|
||||
UTCTime = 23,
|
||||
GeneralizedTime = 24,
|
||||
GraphicString = 25,
|
||||
VisibleString = 26,
|
||||
GeneralString = 28,
|
||||
UniversalString = 29,
|
||||
CharacterString = 30,
|
||||
BMPString = 31,
|
||||
Constructor = 32,
|
||||
Context = 128,
|
||||
}
|
||||
|
||||
*/
|
||||
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"noUnusedParameters": true,
|
||||
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"asn1-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
Vendored
+2
@@ -812,6 +812,8 @@ export interface AuthorizeOptions {
|
||||
login_hint?: string;
|
||||
prompt?: string;
|
||||
mode?: "login" | "signUp";
|
||||
accessType?: string;
|
||||
approvalPrompt?: string;
|
||||
}
|
||||
|
||||
export interface CheckSessionOptions extends AuthorizeOptions {
|
||||
|
||||
@@ -1056,3 +1056,113 @@ const firehoseEventHandler: AWSLambda.FirehoseTransformationHandler = (
|
||||
]
|
||||
});
|
||||
};
|
||||
|
||||
declare let lexEvent: AWSLambda.LexEvent;
|
||||
lexEvent = {
|
||||
currentIntent: {
|
||||
name: 'intent-name',
|
||||
slots: {
|
||||
slot1: null,
|
||||
slot2: 'value2',
|
||||
},
|
||||
slotDetails: {
|
||||
slot1: {
|
||||
resolutions: [
|
||||
{ value: 'value1' },
|
||||
],
|
||||
originalValue: 'originalValue',
|
||||
}
|
||||
},
|
||||
confirmationStatus: 'None',
|
||||
},
|
||||
bot: {
|
||||
name: 'bot name',
|
||||
alias: 'bot alias',
|
||||
version: 'bot version',
|
||||
},
|
||||
userId: 'User ID specified in the POST request to Amazon Lex.',
|
||||
inputTranscript: 'Text used to process the request',
|
||||
invocationSource: 'FulfillmentCodeHook',
|
||||
outputDialogMode: 'Text',
|
||||
messageVersion: '1.0',
|
||||
sessionAttributes: {
|
||||
key1: 'value1',
|
||||
key2: 'value2',
|
||||
},
|
||||
requestAttributes: {
|
||||
key1: 'value1',
|
||||
key2: 'value2',
|
||||
}
|
||||
};
|
||||
|
||||
declare let lexResult: AWSLambda.LexResult;
|
||||
declare let lexDialogAction: AWSLambda.LexDialogAction;
|
||||
declare let lexDialogActionBase: AWSLambda.LexDialogActionBase;
|
||||
declare let lexDialogActionClose: AWSLambda.LexDialogActionClose;
|
||||
declare let lexDialogActionConfirmIntent: AWSLambda.LexDialogActionConfirmIntent;
|
||||
declare let lexDialogActionDelegate: AWSLambda.LexDialogActionDelegate;
|
||||
declare let lexDialogActionElicitIntent: AWSLambda.LexDialogActionElicitIntent;
|
||||
declare let lexDialogActionElicitSlot: AWSLambda.LexDialogActionElicitSlot;
|
||||
declare let lexGenericAttachment: AWSLambda.LexGenericAttachment;
|
||||
|
||||
lexResult = {
|
||||
sessionAttributes: {
|
||||
attrib1: 'Value One',
|
||||
},
|
||||
dialogAction: {
|
||||
type: 'Close',
|
||||
fulfillmentState: 'Failed',
|
||||
},
|
||||
};
|
||||
|
||||
str = lexGenericAttachment.title;
|
||||
str = lexGenericAttachment.subTitle;
|
||||
str = lexGenericAttachment.imageUrl;
|
||||
str = lexGenericAttachment.attachmentLinkUrl;
|
||||
str = lexGenericAttachment.buttons[0].text;
|
||||
str = lexGenericAttachment.buttons[0].value;
|
||||
|
||||
lexDialogAction.type === 'Close';
|
||||
lexDialogAction.type === 'ConfirmIntent';
|
||||
lexDialogAction.type === 'Delegate';
|
||||
lexDialogAction.type === 'ElicitIntent';
|
||||
lexDialogAction.type === 'ElicitSlot';
|
||||
|
||||
lexDialogActionBase.message!.contentType === 'CustomPayload';
|
||||
lexDialogActionBase.message!.contentType === 'PlainText';
|
||||
lexDialogActionBase.message!.contentType === 'SSML';
|
||||
str = lexDialogActionBase.message!.content;
|
||||
num = lexDialogActionBase.responseCard!.version;
|
||||
lexDialogActionBase.responseCard!.contentType === 'application/vnd.amazonaws.card.generic';
|
||||
// $ExpectType LexGenericAttachment
|
||||
lexDialogActionBase.responseCard!.genericAttachments[0];
|
||||
|
||||
lexDialogActionClose.type === 'Close';
|
||||
lexDialogActionClose.fulfillmentState === 'Failed';
|
||||
lexDialogActionClose.fulfillmentState === 'Fulfilled';
|
||||
|
||||
lexDialogActionConfirmIntent.type === 'ConfirmIntent';
|
||||
str = lexDialogActionConfirmIntent.intentName;
|
||||
strOrNull = lexDialogActionConfirmIntent.slots['example'];
|
||||
|
||||
lexDialogActionDelegate.type === 'Delegate';
|
||||
strOrNull = lexDialogActionDelegate.slots['example'];
|
||||
|
||||
lexDialogActionElicitIntent.type === 'ElicitIntent';
|
||||
lexDialogActionElicitSlot.type === 'ElicitSlot';
|
||||
strOrNull = lexDialogActionElicitSlot.slots['example'];
|
||||
str = lexDialogActionElicitSlot.slotToElicit;
|
||||
str = lexDialogActionElicitSlot.intentName;
|
||||
|
||||
const lexEventHandler: AWSLambda.LexHandler = async (
|
||||
event: AWSLambda.LexEvent,
|
||||
context: AWSLambda.Context,
|
||||
) => {
|
||||
// $ExpectType LexEvent
|
||||
event;
|
||||
|
||||
// $ExpectType Context
|
||||
context;
|
||||
str = context.functionName;
|
||||
return lexResult;
|
||||
};
|
||||
|
||||
Vendored
+97
@@ -876,6 +876,100 @@ export interface SQSMessageAttributes {
|
||||
[name: string]: SQSMessageAttribute;
|
||||
}
|
||||
|
||||
// Lex
|
||||
// https://docs.aws.amazon.com/lambda/latest/dg/invoking-lambda-function.html#supported-event-source-lex
|
||||
export interface LexEvent {
|
||||
currentIntent: {
|
||||
name: string;
|
||||
slots: { [name: string]: string | null };
|
||||
slotDetails: LexSlotDetails;
|
||||
confirmationStatus: 'None' | 'Confirmed' | 'Denied';
|
||||
};
|
||||
bot: {
|
||||
name: string;
|
||||
alias: string;
|
||||
version: string;
|
||||
};
|
||||
userId: string;
|
||||
inputTranscript: string;
|
||||
invocationSource: 'DialogCodeHook' | 'FulfillmentCodeHook';
|
||||
outputDialogMode: 'Text' | 'Voice';
|
||||
messageVersion: '1.0';
|
||||
sessionAttributes: { [key: string]: string };
|
||||
requestAttributes: { [key: string]: string } | null;
|
||||
}
|
||||
|
||||
export interface LexSlotResolution {
|
||||
value: string;
|
||||
}
|
||||
|
||||
export interface LexSlotDetails {
|
||||
[name: string]: {
|
||||
// The following line only works in TypeScript Version: 3.0, The array should have at least 1 and no more than 5 items
|
||||
// resolutions: [LexSlotResolution, LexSlotResolution?, LexSlotResolution?, LexSlotResolution?, LexSlotResolution?];
|
||||
resolutions: LexSlotResolution[]
|
||||
originalValue: string;
|
||||
};
|
||||
}
|
||||
|
||||
export interface LexGenericAttachment {
|
||||
title: string;
|
||||
subTitle: string;
|
||||
imageUrl: string;
|
||||
attachmentLinkUrl: string;
|
||||
buttons: Array<{
|
||||
text: string;
|
||||
value: string;
|
||||
}>;
|
||||
}
|
||||
|
||||
export interface LexDialogActionBase {
|
||||
type: 'Close' | 'ElicitIntent' | 'ElicitSlot' | 'ConfirmIntent';
|
||||
message?: {
|
||||
contentType: 'PlainText' | 'SSML' | 'CustomPayload';
|
||||
content: string;
|
||||
};
|
||||
responseCard?: {
|
||||
version: number;
|
||||
contentType: 'application/vnd.amazonaws.card.generic';
|
||||
genericAttachments: LexGenericAttachment[];
|
||||
};
|
||||
}
|
||||
|
||||
export interface LexDialogActionClose extends LexDialogActionBase {
|
||||
type: 'Close';
|
||||
fulfillmentState: 'Fulfilled' | 'Failed';
|
||||
}
|
||||
|
||||
export interface LexDialogActionElicitIntent extends LexDialogActionBase {
|
||||
type: 'ElicitIntent';
|
||||
}
|
||||
|
||||
export interface LexDialogActionElicitSlot extends LexDialogActionBase {
|
||||
type: 'ElicitSlot';
|
||||
intentName: string;
|
||||
slots: { [name: string]: string | null };
|
||||
slotToElicit: string;
|
||||
}
|
||||
|
||||
export interface LexDialogActionConfirmIntent extends LexDialogActionBase {
|
||||
type: 'ConfirmIntent';
|
||||
intentName: string;
|
||||
slots: { [name: string]: string | null };
|
||||
}
|
||||
|
||||
export interface LexDialogActionDelegate {
|
||||
type: 'Delegate';
|
||||
slots: { [name: string]: string | null };
|
||||
}
|
||||
|
||||
export type LexDialogAction = LexDialogActionClose | LexDialogActionElicitIntent | LexDialogActionElicitSlot | LexDialogActionConfirmIntent | LexDialogActionDelegate;
|
||||
|
||||
export interface LexResult {
|
||||
sessionAttributes?: { [key: string]: string };
|
||||
dialogAction: LexDialogAction;
|
||||
}
|
||||
|
||||
/**
|
||||
* AWS Lambda handler function.
|
||||
* http://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-handler.html
|
||||
@@ -938,6 +1032,9 @@ export type ScheduledHandler = Handler<ScheduledEvent, void>;
|
||||
|
||||
// TODO: Alexa
|
||||
|
||||
export type LexHandler = Handler<LexEvent, LexResult>;
|
||||
export type LexCallback = Callback<LexResult>;
|
||||
|
||||
export type APIGatewayProxyHandler = Handler<APIGatewayProxyEvent, APIGatewayProxyResult>;
|
||||
export type APIGatewayProxyCallback = Callback<APIGatewayProxyResult>;
|
||||
export type ProxyHandler = APIGatewayProxyHandler; // Old name
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
import axios from "axios";
|
||||
import applyConverters from "axios-case-converter";
|
||||
|
||||
applyConverters(); // $ExpectError
|
||||
|
||||
applyConverters(axios.create()); // $ExpectType AxiosInstance
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// Type definitions for axios-case-converter 0.3
|
||||
// Project: https://github.com/mpyw/axios-case-converter
|
||||
// Definitions by: Derek Kniffin <https://github.com/dkniffin>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
import { AxiosInstance } from "axios";
|
||||
|
||||
export default function applyConverters(axios: AxiosInstance): AxiosInstance;
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"axios": "^0.16.1"
|
||||
}
|
||||
}
|
||||
@@ -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",
|
||||
"axios-case-converter-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
@@ -150,3 +150,8 @@ const VisitorStateTest: Visitor<SomeVisitorState> = {
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const VisitorAliasTest: Visitor = {
|
||||
Function() {},
|
||||
Expression() {},
|
||||
};
|
||||
|
||||
Vendored
+2
@@ -145,6 +145,8 @@ export class Binding {
|
||||
|
||||
export type Visitor<S = {}> = VisitNodeObject<S, Node> & {
|
||||
[Type in Node["type"]]?: VisitNode<S, Extract<Node, { type: Type; }>>;
|
||||
} & {
|
||||
[K in keyof t.Aliases]?: VisitNode<S, t.Aliases[K]>
|
||||
};
|
||||
|
||||
export type VisitNode<S, P> = VisitNodeFunction<S, P> | VisitNodeObject<S, P>;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@babel/types": "^7.0.0"
|
||||
"@babel/types": "^7.3.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,3 +69,12 @@ trans.default('name');
|
||||
trans.deferred('name');
|
||||
trans.immediate('name');
|
||||
trans.exclusive('name');
|
||||
|
||||
const transTyped = db.transaction((param: number) => stmt.all(param));
|
||||
transTyped(1);
|
||||
trans.default(1);
|
||||
trans.deferred(1);
|
||||
trans.immediate(1);
|
||||
trans.exclusive(1);
|
||||
// $ExpectError
|
||||
transTyped('name');
|
||||
|
||||
Vendored
+15
-8
@@ -4,10 +4,17 @@
|
||||
// Mathew Rumsey <https://github.com/matrumz>
|
||||
// Santiago Aguilar <https://github.com/sant123>
|
||||
// Alessandro Vergani <https://github.com/loghorn>
|
||||
// Andrew Kaiser <https://github.com/andykais>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 3.0
|
||||
|
||||
import Integer = require("integer");
|
||||
|
||||
type VariableArgFunction = (...params: any[]) => any;
|
||||
type ArgumentTypes<F extends VariableArgFunction> = F extends (...args: infer A) => any
|
||||
? A
|
||||
: never;
|
||||
|
||||
declare namespace BetterSqlite3 {
|
||||
interface Statement {
|
||||
database: Database;
|
||||
@@ -34,12 +41,12 @@ declare namespace BetterSqlite3 {
|
||||
type: string | null;
|
||||
}
|
||||
|
||||
interface Transaction {
|
||||
(...params: any[]): any;
|
||||
default(...params: any[]): any;
|
||||
deferred(...params: any[]): any;
|
||||
immediate(...params: any[]): any;
|
||||
exclusive(...params: any[]): any;
|
||||
interface Transaction<F extends VariableArgFunction> {
|
||||
(...params: ArgumentTypes<F>): any;
|
||||
default(...params: ArgumentTypes<F>): any;
|
||||
deferred(...params: ArgumentTypes<F>): any;
|
||||
immediate(...params: ArgumentTypes<F>): any;
|
||||
exclusive(...params: ArgumentTypes<F>): any;
|
||||
}
|
||||
|
||||
interface Database {
|
||||
@@ -50,7 +57,7 @@ declare namespace BetterSqlite3 {
|
||||
inTransaction: boolean;
|
||||
|
||||
prepare(source: string): Statement;
|
||||
transaction(fn: (...params: any[]) => any): Transaction;
|
||||
transaction<F extends VariableArgFunction>(fn: F): Transaction<F>;
|
||||
exec(source: string): this;
|
||||
pragma(source: string, options?: Database.PragmaOptions): any;
|
||||
checkpoint(databaseName?: string): this;
|
||||
@@ -113,7 +120,7 @@ declare namespace Database {
|
||||
type SqliteError = typeof SqliteError;
|
||||
type Statement = BetterSqlite3.Statement;
|
||||
type ColumnDefinition = BetterSqlite3.ColumnDefinition;
|
||||
type Transaction = BetterSqlite3.Transaction;
|
||||
type Transaction = BetterSqlite3.Transaction<VariableArgFunction>;
|
||||
type Database = BetterSqlite3.Database;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
import btoa from 'btoa';
|
||||
import btoa = require('btoa');
|
||||
|
||||
btoa('foo');
|
||||
|
||||
Vendored
+4
-1
@@ -1,7 +1,10 @@
|
||||
// Type definitions for btoa 1.2
|
||||
// Project: https://git.coolaj86.com/coolaj86/btoa.js
|
||||
// Definitions by: John Wright <https://github.com/johngeorgewright>
|
||||
// Alex Brick <https://github.com/bricka>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
export default function(str: string): string;
|
||||
declare function btoa(str: string): string;
|
||||
|
||||
export = btoa;
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
import * as buble from 'buble';
|
||||
|
||||
const input = 'const answer = () => 42;';
|
||||
|
||||
// Simple transform
|
||||
(() => {
|
||||
const output = buble.transform(input);
|
||||
|
||||
console.log(output.code);
|
||||
console.log(output.map.toString());
|
||||
console.log(output.map.toUrl());
|
||||
})();
|
||||
|
||||
// Transform for Chrome & Firefox
|
||||
(() => {
|
||||
const output = buble.transform(input, {
|
||||
target: {
|
||||
chrome: 71,
|
||||
firefox: 64,
|
||||
},
|
||||
});
|
||||
})();
|
||||
|
||||
// Transform with sourcemaps support
|
||||
(() => {
|
||||
const output = buble.transform(input, {
|
||||
source: 'input.js',
|
||||
file: 'output.js',
|
||||
includeContent: true,
|
||||
});
|
||||
})();
|
||||
|
||||
// Transform for Preact
|
||||
(() => {
|
||||
const output = buble.transform(input, {
|
||||
jsx: 'h'
|
||||
});
|
||||
})();
|
||||
|
||||
// Transform with Object assign/spread support
|
||||
(() => {
|
||||
let output = buble.transform(input, {
|
||||
objectAssign: true,
|
||||
});
|
||||
output = buble.transform(input, {
|
||||
objectAssign: 'MyCustomObjectAssign',
|
||||
});
|
||||
})();
|
||||
|
||||
// Transform with every transforms
|
||||
(() => {
|
||||
const output = buble.transform(input, {
|
||||
transforms: {
|
||||
arrow: true,
|
||||
classes: false,
|
||||
collections: true,
|
||||
computedProperty: false,
|
||||
conciseMethodProperty: true,
|
||||
constLoop: false,
|
||||
dangerousForOf: true,
|
||||
dangerousTaggedTemplateString: false,
|
||||
defaultParameter: true,
|
||||
destructuring: false,
|
||||
forOf: true,
|
||||
generator: false,
|
||||
letConst: true,
|
||||
modules: false,
|
||||
numericLiteral: true,
|
||||
parameterDestructuring: false,
|
||||
reservedProperties: true,
|
||||
spreadRest: false,
|
||||
stickyRegExp: true,
|
||||
templateString: false,
|
||||
unicodeRegExp: true,
|
||||
}
|
||||
});
|
||||
})();
|
||||
Vendored
+65
@@ -0,0 +1,65 @@
|
||||
// Type definitions for buble 0.19
|
||||
// Project: https://github.com/Rich-Harris/buble#README
|
||||
// Definitions by: Hugo Alliaume <https://github.com/Kocal>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.1
|
||||
|
||||
import { SourceMap } from "magic-string";
|
||||
|
||||
export interface TransformOptions {
|
||||
// source: https://github.com/Rich-Harris/buble/blob/master/src/support.js
|
||||
target?: {
|
||||
chrome?: 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71;
|
||||
firefox?: 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64;
|
||||
safari?: 8 | 9 | 10 | 10.1 | 11 | 11.1 | 12;
|
||||
ie?: 8 | 9 | 10 | 11;
|
||||
edge?: 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19;
|
||||
node?: 0.10 | 0.12 | 4 | 5 | 6 | 8 | 8.3 | 8.7 | 8.10;
|
||||
};
|
||||
|
||||
// used for sourcemaps
|
||||
source?: string; // input
|
||||
file?: string; // output
|
||||
includeContent?: boolean;
|
||||
|
||||
// custom JSX pragma (https://buble.surge.sh/guide/#jsx)
|
||||
jsx?: string; // default: 'React.createElement'
|
||||
|
||||
// custom `Object.assign` (https://buble.surge.sh/guide/#object-spread-and-rest)
|
||||
objectAssign?: string | boolean;
|
||||
|
||||
// transforms
|
||||
transforms?: {
|
||||
arrow?: boolean;
|
||||
classes?: boolean;
|
||||
collections?: boolean;
|
||||
computedProperty?: boolean;
|
||||
conciseMethodProperty?: boolean;
|
||||
constLoop?: boolean;
|
||||
dangerousForOf?: boolean;
|
||||
dangerousTaggedTemplateString?: boolean;
|
||||
defaultParameter?: boolean;
|
||||
destructuring?: boolean;
|
||||
forOf?: boolean;
|
||||
generator?: boolean;
|
||||
letConst?: boolean;
|
||||
modules?: boolean;
|
||||
numericLiteral?: boolean;
|
||||
parameterDestructuring?: boolean;
|
||||
reservedProperties?: boolean;
|
||||
spreadRest?: boolean;
|
||||
stickyRegExp?: boolean;
|
||||
templateString?: boolean;
|
||||
unicodeRegExp?: boolean;
|
||||
};
|
||||
|
||||
// others
|
||||
namedFunctionExpressions?: boolean;
|
||||
}
|
||||
|
||||
export interface TransformOutput {
|
||||
code: string;
|
||||
map: SourceMap;
|
||||
}
|
||||
|
||||
export function transform(content: string, options?: TransformOptions): TransformOutput;
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"csstype": "^2.2.0"
|
||||
"magic-string": "^0.25.0"
|
||||
}
|
||||
}
|
||||
@@ -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",
|
||||
"buble-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Vendored
+5
@@ -585,6 +585,11 @@ declare namespace Bull {
|
||||
*/
|
||||
getJobCounts(): Promise<JobCounts>;
|
||||
|
||||
/**
|
||||
* Returns a promise that resolves with the job counts for the given queue of the given types.
|
||||
*/
|
||||
getJobCountByTypes(types: string[] | string): Promise<JobCounts>;
|
||||
|
||||
/**
|
||||
* Returns a promise that resolves with the quantity of completed jobs.
|
||||
*/
|
||||
|
||||
Vendored
+6
-1
@@ -127,7 +127,7 @@ declare class ByteBuffer
|
||||
* Calculates the number of UTF8 characters of a string.JavaScript itself uses UTF- 16, so that a string's length property does not reflect its actual UTF8 size if it contains code points larger than 0xFFFF.
|
||||
*/
|
||||
static calculateUTF8Chars( str: string ): number;
|
||||
|
||||
|
||||
/**
|
||||
* Calculates the number of UTF8 bytes of a string. This is an alias of ByteBuffer#calculateUTF8Bytes.
|
||||
*/
|
||||
@@ -574,6 +574,11 @@ declare class ByteBuffer
|
||||
*/
|
||||
writeInt8( value: number, offset?: number ): ByteBuffer;
|
||||
|
||||
/**
|
||||
* Write a 64bit signed integer. This is an alias of ByteBuffer#writeInt64.
|
||||
*/
|
||||
writeLong( value: number | Long, offset?: number ): ByteBuffer;
|
||||
|
||||
/**
|
||||
* Writes a 16bit signed integer. This is an alias of ByteBuffer#writeInt16.
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
import * as http from 'http';
|
||||
import * as https from 'https';
|
||||
import CacheableRequest = require('cacheable-request');
|
||||
import QuickLRU = require('quick-lru');
|
||||
|
||||
// You can do
|
||||
let cacheableRequest = new CacheableRequest(http.request);
|
||||
const cacheReq = cacheableRequest('http://example.com', res => {
|
||||
res; // $ExpectType ServerResponse | ResponseLike
|
||||
});
|
||||
cacheReq.on('request', req => req.end());
|
||||
|
||||
cacheableRequest = new CacheableRequest(https.request);
|
||||
|
||||
cacheableRequest = new CacheableRequest(http.request, 'redis://user:pass@localhost:6379');
|
||||
cacheableRequest = new CacheableRequest(http.request, new Map());
|
||||
cacheableRequest = new CacheableRequest(http.request, new QuickLRU({ maxSize: 1000 }));
|
||||
|
||||
cacheableRequest('example.com', res => {
|
||||
res; // $ExpectType ServerResponse | ResponseLike
|
||||
})
|
||||
.on('error', err => {
|
||||
err; // $ExpectType RequestErrorCls | CacheErrorCls
|
||||
})
|
||||
.on('request', req => {
|
||||
req.on('error', () => {});
|
||||
req.end();
|
||||
});
|
||||
Vendored
+134
@@ -0,0 +1,134 @@
|
||||
// Type definitions for cacheable-request 6.0
|
||||
// Project: https://github.com/lukechilds/cacheable-request#readme
|
||||
// Definitions by: BendingBender <https://github.com/BendingBender>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
import { request, RequestOptions, ClientRequest, ServerResponse } from 'http';
|
||||
import { URL } from 'url';
|
||||
import { EventEmitter } from 'events';
|
||||
import { Store } from 'keyv';
|
||||
import { Options as CacheSemanticsOptions } from 'http-cache-semantics';
|
||||
import ResponseLike = require('responselike');
|
||||
|
||||
export = CacheableRequest;
|
||||
|
||||
declare const CacheableRequest: CacheableRequest;
|
||||
|
||||
type RequestFn = typeof request;
|
||||
|
||||
interface CacheableRequest {
|
||||
new (requestFn: RequestFn, storageAdapter?: string | Store<any>): (
|
||||
opts: string | URL | (RequestOptions & CacheSemanticsOptions),
|
||||
cb?: (response: ServerResponse | ResponseLike) => void
|
||||
) => CacheableRequest.Emitter;
|
||||
|
||||
RequestError: typeof RequestErrorCls;
|
||||
CacheError: typeof CacheErrorCls;
|
||||
}
|
||||
|
||||
declare namespace CacheableRequest {
|
||||
interface Options {
|
||||
/**
|
||||
* If the cache should be used. Setting this to `false` will completely bypass the cache for the current request.
|
||||
* @default true
|
||||
*/
|
||||
cache?: boolean;
|
||||
|
||||
/**
|
||||
* If set to `true` once a cached resource has expired it is deleted and will have to be re-requested.
|
||||
*
|
||||
* If set to `false`, after a cached resource's TTL expires it is kept in the cache and will be revalidated
|
||||
* on the next request with `If-None-Match`/`If-Modified-Since` headers.
|
||||
* @default false
|
||||
*/
|
||||
strictTtl?: boolean;
|
||||
|
||||
/**
|
||||
* Limits TTL. The `number` represents milliseconds.
|
||||
* @default undefined
|
||||
*/
|
||||
maxTtl?: number;
|
||||
|
||||
/**
|
||||
* When set to `true`, if the DB connection fails we will automatically fallback to a network request.
|
||||
* DB errors will still be emitted to notify you of the problem even though the request callback may succeed.
|
||||
* @default false
|
||||
*/
|
||||
automaticFailover?: boolean;
|
||||
|
||||
/**
|
||||
* Forces refreshing the cache. If the response could be retrieved from the cache, it will perform a
|
||||
* new request and override the cache instead.
|
||||
* @default false
|
||||
*/
|
||||
forceRefresh?: boolean;
|
||||
}
|
||||
|
||||
interface Emitter extends EventEmitter {
|
||||
addListener(event: 'request', listener: (request: ClientRequest) => void): this;
|
||||
addListener(
|
||||
event: 'response',
|
||||
listener: (response: ServerResponse | ResponseLike) => void
|
||||
): this;
|
||||
addListener(event: 'error', listener: (error: RequestError | CacheError) => void): this;
|
||||
on(event: 'request', listener: (request: ClientRequest) => void): this;
|
||||
on(event: 'response', listener: (response: ServerResponse | ResponseLike) => void): this;
|
||||
on(event: 'error', listener: (error: RequestError | CacheError) => void): this;
|
||||
once(event: 'request', listener: (request: ClientRequest) => void): this;
|
||||
once(event: 'response', listener: (response: ServerResponse | ResponseLike) => void): this;
|
||||
once(event: 'error', listener: (error: RequestError | CacheError) => void): this;
|
||||
prependListener(event: 'request', listener: (request: ClientRequest) => void): this;
|
||||
prependListener(
|
||||
event: 'response',
|
||||
listener: (response: ServerResponse | ResponseLike) => void
|
||||
): this;
|
||||
prependListener(event: 'error', listener: (error: RequestError | CacheError) => void): this;
|
||||
prependOnceListener(event: 'request', listener: (request: ClientRequest) => void): this;
|
||||
prependOnceListener(
|
||||
event: 'response',
|
||||
listener: (response: ServerResponse | ResponseLike) => void
|
||||
): this;
|
||||
prependOnceListener(
|
||||
event: 'error',
|
||||
listener: (error: RequestError | CacheError) => void
|
||||
): this;
|
||||
removeListener(event: 'request', listener: (request: ClientRequest) => void): this;
|
||||
removeListener(
|
||||
event: 'response',
|
||||
listener: (response: ServerResponse | ResponseLike) => void
|
||||
): this;
|
||||
removeListener(event: 'error', listener: (error: RequestError | CacheError) => void): this;
|
||||
off(event: 'request', listener: (request: ClientRequest) => void): this;
|
||||
off(event: 'response', listener: (response: ServerResponse | ResponseLike) => void): this;
|
||||
off(event: 'error', listener: (error: RequestError | CacheError) => void): this;
|
||||
removeAllListeners(event?: 'request' | 'response' | 'error'): this;
|
||||
listeners(event: 'request'): Array<(request: ClientRequest) => void>;
|
||||
listeners(event: 'response'): Array<(response: ServerResponse | ResponseLike) => void>;
|
||||
listeners(event: 'error'): Array<(error: RequestError | CacheError) => void>;
|
||||
rawListeners(event: 'request'): Array<(request: ClientRequest) => void>;
|
||||
rawListeners(event: 'response'): Array<(response: ServerResponse | ResponseLike) => void>;
|
||||
rawListeners(event: 'error'): Array<(error: RequestError | CacheError) => void>;
|
||||
emit(event: 'request', request: ClientRequest): boolean;
|
||||
emit(event: 'response', response: ServerResponse | ResponseLike): boolean;
|
||||
emit(event: 'error', error: RequestError | CacheError): boolean;
|
||||
eventNames(): Array<'request' | 'response' | 'error'>;
|
||||
listenerCount(type: 'request' | 'response' | 'error'): number;
|
||||
}
|
||||
|
||||
type RequestError = RequestErrorCls;
|
||||
type CacheError = CacheErrorCls;
|
||||
}
|
||||
|
||||
declare class RequestErrorCls extends Error {
|
||||
readonly name: 'RequestError';
|
||||
|
||||
constructor(error: Error);
|
||||
}
|
||||
declare class CacheErrorCls extends Error {
|
||||
readonly name: 'CacheError';
|
||||
|
||||
constructor(error: Error);
|
||||
}
|
||||
@@ -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",
|
||||
"cacheable-request-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Vendored
+1
-1
@@ -231,7 +231,7 @@ export interface DecoratedPolicyOptions<T> extends PolicyOptions<T> {
|
||||
/**
|
||||
* @default false
|
||||
*/
|
||||
getDecoratedValue?: boolean;
|
||||
getDecoratedValue: boolean | undefined;
|
||||
}
|
||||
|
||||
export interface GenerateFuncFlags {
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@types/webdriverio": "^4.0.0"
|
||||
}
|
||||
}
|
||||
Vendored
+1
@@ -537,6 +537,7 @@ declare namespace Chart {
|
||||
interface LinearTickOptions extends TickOptions {
|
||||
maxTicksLimit?: number;
|
||||
stepSize?: number;
|
||||
precision?: number;
|
||||
suggestedMin?: number;
|
||||
suggestedMax?: number;
|
||||
}
|
||||
|
||||
@@ -485,3 +485,53 @@ new Chartist.Candle('.ct-chart', {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// Create a simple bar chart and line chart with two dimensional arrays
|
||||
new Chartist.Bar('.ct-chart', {
|
||||
labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
|
||||
series: [
|
||||
[
|
||||
{value: 1},
|
||||
{value: 2},
|
||||
{value: 3},
|
||||
{value: 4},
|
||||
{value: 5},
|
||||
{value: 6},
|
||||
{value: 7}
|
||||
],
|
||||
[
|
||||
{value: 7},
|
||||
{value: 6},
|
||||
{value: 5},
|
||||
{value: 4},
|
||||
{value: 3},
|
||||
{value: 2},
|
||||
{value: 1}
|
||||
]
|
||||
]
|
||||
}, {})
|
||||
|
||||
new Chartist.Line('.ct-chart', {
|
||||
labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
|
||||
series: [
|
||||
[
|
||||
{value: 1},
|
||||
{value: 2},
|
||||
{value: 3},
|
||||
{value: 4},
|
||||
{value: 5},
|
||||
{value: 6},
|
||||
{value: 7}
|
||||
],
|
||||
[
|
||||
{value: 7},
|
||||
{value: 6},
|
||||
{value: 5},
|
||||
{value: 4},
|
||||
{value: 3},
|
||||
{value: 2},
|
||||
{value: 1}
|
||||
]
|
||||
]
|
||||
}, {})
|
||||
|
||||
Vendored
+1
-1
@@ -93,7 +93,7 @@ declare namespace Chartist {
|
||||
// TODO: come in and tidy this up and make it fit better
|
||||
interface IChartistData {
|
||||
labels?: Array<string> | Array<number> | Array<Date>;
|
||||
series: Array<IChartistSeriesData> | Array<Array<IChartistData>> | Array<number> | Array<Array<number>>;
|
||||
series: Array<IChartistSeriesData> | Array<Array<IChartistSeriesData>> | Array<Array<IChartistData>> | Array<number> | Array<Array<number>>;
|
||||
}
|
||||
|
||||
interface IChartistSeriesData {
|
||||
|
||||
@@ -289,6 +289,17 @@ function test_dom_node() {
|
||||
strong.insertBefore(em);
|
||||
strong.insertBeforeMe(em);
|
||||
element.isReadOnly();
|
||||
var prev = node.getPreviousSourceNode();
|
||||
prev = node.getPreviousSourceNode(true);
|
||||
prev = node.getPreviousSourceNode(true, CKEDITOR.NODE_TEXT);
|
||||
prev = node.getPreviousSourceNode(true, CKEDITOR.NODE_COMMENT, node);
|
||||
prev = node.getPreviousSourceNode(true, CKEDITOR.NODE_COMMENT, (current: CKEDITOR.dom.node) => false);
|
||||
var next = node.getNextSourceNode();
|
||||
next = node.getNextSourceNode(true);
|
||||
next = node.getNextSourceNode(true, CKEDITOR.NODE_ELEMENT);
|
||||
next = node.getNextSourceNode(true, CKEDITOR.NODE_DOCUMENT, node);
|
||||
next = node.getNextSourceNode(true, CKEDITOR.NODE_DOCUMENT_FRAGMENT, (current: CKEDITOR.dom.node) => true);
|
||||
console.log(node.type);
|
||||
}
|
||||
|
||||
function test_dom_nodeList() {
|
||||
|
||||
Vendored
+3
-2
@@ -333,6 +333,7 @@ declare namespace CKEDITOR {
|
||||
}
|
||||
|
||||
class node extends domObject {
|
||||
type: number;
|
||||
constructor(domNode: Node);
|
||||
appendTo(element: element): element;
|
||||
clone(includeChildren: boolean, cloneId: boolean): node;
|
||||
@@ -347,12 +348,12 @@ declare namespace CKEDITOR {
|
||||
getDocument(): document;
|
||||
getIndex(normalized?: boolean): number;
|
||||
getNext(evaluator?: (node: node) => boolean): node;
|
||||
getNextSourceNode(startFromSibling: boolean, nodeType: number, guard: node | ((node: node) => boolean)): void;
|
||||
getNextSourceNode(startFromSibling?: boolean, nodeType?: number, guard?: node | ((node: node) => boolean)): node;
|
||||
getParent(allowFragmentParent?: boolean): element;
|
||||
getParents(closerFirst?: boolean): node[];
|
||||
getPosition(otherNode: node): void;
|
||||
getPrevious(evaluator?: (node: node) => boolean): node;
|
||||
getPreviousSourceNode(startFromSibling: boolean, nodeType: number, guard: node | ((node: node) => boolean)): void;
|
||||
getPreviousSourceNode(startFromSibling?: boolean, nodeType?: number, guard?: node | ((node: node) => boolean)): node;
|
||||
hasAscendant(name: string, includeSelf: boolean): boolean;
|
||||
remove(preserveChildren?: boolean): node;
|
||||
replace(nodeToReplace: node): void;
|
||||
|
||||
@@ -81,3 +81,18 @@ new CleanCSS({ returnPromise: true, sourceMap: true }).minify(source, inputSourc
|
||||
console.log(error);
|
||||
}
|
||||
);
|
||||
|
||||
// test object return when passing options as object
|
||||
let CleanCssOptions: CleanCSS.Options = { returnPromise: true };
|
||||
new CleanCSS(CleanCssOptions).minify(source)
|
||||
.then((minified: CleanCSS.Output): void => {
|
||||
console.log(minified.styles);
|
||||
}).catch((error: any): void => {
|
||||
console.log(error);
|
||||
}
|
||||
);
|
||||
|
||||
CleanCssOptions = { returnPromise: false };
|
||||
new CleanCSS(CleanCssOptions).minify(source, (error: any, minified: CleanCSS.Output): void => {
|
||||
console.log(minified.styles);
|
||||
});
|
||||
|
||||
Vendored
+89
-66
@@ -8,83 +8,78 @@
|
||||
import { RequestOptions as HttpsRequestOptions } from "https";
|
||||
import { RequestOptions as HttpRequestOptions } from "http";
|
||||
|
||||
declare namespace CleanCSS {
|
||||
/**
|
||||
* Shared options passed when initializing a new instance of CleanCSS that returns either a promise or output
|
||||
*/
|
||||
interface OptionsBase {
|
||||
/**
|
||||
* Options passed when initializing a new instance of CleanCSS
|
||||
* Controls compatibility mode used; defaults to ie10+ using `'*'`.
|
||||
* Compatibility hash exposes the following properties: `colors`, `properties`, `selectors`, and `units`
|
||||
*/
|
||||
interface Options {
|
||||
/**
|
||||
* Controls compatibility mode used; defaults to ie10+ using `'*'`.
|
||||
* Compatibility hash exposes the following properties: `colors`, `properties`, `selectors`, and `units`
|
||||
*/
|
||||
compatibility?: "*" | "ie9" | "ie8" | "ie7" | CompatibilityOptions;
|
||||
compatibility?: "*" | "ie9" | "ie8" | "ie7" | CleanCSS.CompatibilityOptions;
|
||||
|
||||
/**
|
||||
* Controls a function for handling remote requests; Defaults to the build in `loadRemoteResource` function
|
||||
*/
|
||||
fetch?: (uri: string, inlineRequest: HttpRequestOptions | HttpsRequestOptions, inlineTimeout: number, done: (message: string | number, body: string) => void) => void;
|
||||
/**
|
||||
* Controls a function for handling remote requests; Defaults to the build in `loadRemoteResource` function
|
||||
*/
|
||||
fetch?: (uri: string, inlineRequest: HttpRequestOptions | HttpsRequestOptions, inlineTimeout: number, done: (message: string | number, body: string) => void) => void;
|
||||
|
||||
/**
|
||||
* Controls output CSS formatting; defaults to `false`.
|
||||
* Format hash exposes the following properties: `breaks`, `breakWith`, `indentBy`, `indentWith`, `spaces`, and `wrapAt`.
|
||||
*/
|
||||
format?: "beautify" | "keep-breaks" | FormatOptions | false;
|
||||
/**
|
||||
* Controls output CSS formatting; defaults to `false`.
|
||||
* Format hash exposes the following properties: `breaks`, `breakWith`, `indentBy`, `indentWith`, `spaces`, and `wrapAt`.
|
||||
*/
|
||||
format?: "beautify" | "keep-breaks" | CleanCSS.FormatOptions | false;
|
||||
|
||||
/**
|
||||
* inline option whitelists which @import rules will be processed. Defaults to `'local'`
|
||||
* Accepts the following values:
|
||||
* 'local': enables local inlining;
|
||||
* 'remote': enables remote inlining;
|
||||
* 'none': disables all inlining;
|
||||
* 'all': enables all inlining, same as ['local', 'remote'];
|
||||
* '[uri]': enables remote inlining from the specified uri;
|
||||
* '![url]': disables remote inlining from the specified uri;
|
||||
*/
|
||||
inline?: ReadonlyArray<string> | false;
|
||||
/**
|
||||
* inline option whitelists which @import rules will be processed. Defaults to `'local'`
|
||||
* Accepts the following values:
|
||||
* 'local': enables local inlining;
|
||||
* 'remote': enables remote inlining;
|
||||
* 'none': disables all inlining;
|
||||
* 'all': enables all inlining, same as ['local', 'remote'];
|
||||
* '[uri]': enables remote inlining from the specified uri;
|
||||
* '![url]': disables remote inlining from the specified uri;
|
||||
*/
|
||||
inline?: ReadonlyArray<string> | false;
|
||||
|
||||
/**
|
||||
* Controls extra options for inlining remote @import rules
|
||||
*/
|
||||
inlineRequest?: HttpRequestOptions | HttpsRequestOptions;
|
||||
/**
|
||||
* Controls extra options for inlining remote @import rules
|
||||
*/
|
||||
inlineRequest?: HttpRequestOptions | HttpsRequestOptions;
|
||||
|
||||
/**
|
||||
* Controls number of milliseconds after which inlining a remote @import fails; defaults to `5000`;
|
||||
*/
|
||||
inlineTimeout?: number;
|
||||
/**
|
||||
* Controls number of milliseconds after which inlining a remote @import fails; defaults to `5000`;
|
||||
*/
|
||||
inlineTimeout?: number;
|
||||
|
||||
/**
|
||||
* Controls optimization level used; defaults to `1`.
|
||||
* Level hash exposes `1`, and `2`.
|
||||
*/
|
||||
level?: 0 | 1 | 2 | OptimizationsOptions;
|
||||
/**
|
||||
* Controls optimization level used; defaults to `1`.
|
||||
* Level hash exposes `1`, and `2`.
|
||||
*/
|
||||
level?: 0 | 1 | 2 | CleanCSS.OptimizationsOptions;
|
||||
|
||||
/**
|
||||
* Controls URL rebasing; defaults to `true`;
|
||||
*/
|
||||
rebase?: boolean;
|
||||
/**
|
||||
* Controls URL rebasing; defaults to `true`;
|
||||
*/
|
||||
rebase?: boolean;
|
||||
|
||||
/**
|
||||
* controls a directory to which all URLs are rebased, most likely the directory under which the output file
|
||||
* will live; defaults to the current directory;
|
||||
*/
|
||||
rebaseTo?: string;
|
||||
/**
|
||||
* controls a directory to which all URLs are rebased, most likely the directory under which the output file
|
||||
* will live; defaults to the current directory;
|
||||
*/
|
||||
rebaseTo?: string;
|
||||
|
||||
/**
|
||||
* If you prefer clean-css to return a Promise object then you need to explicitely ask for it; defaults to `false`
|
||||
*/
|
||||
returnPromise?: boolean;
|
||||
/**
|
||||
* Controls whether an output source map is built; defaults to `false`
|
||||
*/
|
||||
sourceMap?: boolean;
|
||||
|
||||
/**
|
||||
* Controls whether an output source map is built; defaults to `false`
|
||||
*/
|
||||
sourceMap?: boolean;
|
||||
|
||||
/**
|
||||
* Controls embedding sources inside a source map's `sourcesContent` field; defaults to `false`
|
||||
*/
|
||||
sourceMapInlineSources?: boolean;
|
||||
}
|
||||
/**
|
||||
* Controls embedding sources inside a source map's `sourcesContent` field; defaults to `false`
|
||||
*/
|
||||
sourceMapInlineSources?: boolean;
|
||||
}
|
||||
|
||||
declare namespace CleanCSS {
|
||||
/**
|
||||
* Output returned when calling minify functions
|
||||
*/
|
||||
@@ -650,12 +645,40 @@ declare namespace CleanCSS {
|
||||
minify(sources: Sources, sourceMap?: string): Promise<Output>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Options when returning a promise
|
||||
*/
|
||||
type OptionsPromise = OptionsBase & {
|
||||
/**
|
||||
* If you prefer clean-css to return a Promise object then you need to explicitly ask for it; defaults to `false`
|
||||
*/
|
||||
returnPromise: true
|
||||
};
|
||||
|
||||
/**
|
||||
* Options when returning an output
|
||||
*/
|
||||
type OptionsOutput = OptionsBase & {
|
||||
/**
|
||||
* If you prefer clean-css to return a Promise object then you need to explicitly ask for it; defaults to `false`
|
||||
*/
|
||||
returnPromise?: false
|
||||
};
|
||||
|
||||
/**
|
||||
* Discriminant union of both sets of options types. If you initialize without setting `returnPromise: true`
|
||||
* and want to return a promise, you will need to cast to the correct options type so that TypeScript
|
||||
* knows what the expected return type will be:
|
||||
* `(options = options as CleanCSS.OptionsPromise).returnPromise = true`
|
||||
*/
|
||||
type Options = OptionsPromise | OptionsOutput;
|
||||
|
||||
/**
|
||||
* Constructor interface for CleanCSS
|
||||
*/
|
||||
interface Constructor {
|
||||
new(options: Options & { returnPromise: true }): MinifierPromise;
|
||||
new(options?: Options): MinifierOutput;
|
||||
new(options: OptionsPromise): MinifierPromise;
|
||||
new(options?: OptionsOutput): MinifierOutput;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import * as React from "react";
|
||||
import Cleave = require("cleave.js");
|
||||
import CleaveReact = require("cleave.js/react");
|
||||
import { Props } from "cleave.js/react/props";
|
||||
import { Props, ChangeEvent } from "cleave.js/react/props";
|
||||
|
||||
const ExampleSelector1 = () => {
|
||||
const cleave = new Cleave("#my-input", { phone: true });
|
||||
@@ -41,3 +41,17 @@ const ExampleReact2 = (props: Props) => {
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
const ExampleReact3 = (props: Props) => {
|
||||
const handleChange = (e: ChangeEvent<HTMLInputElement>) => {
|
||||
return e.target.rawValue;
|
||||
};
|
||||
return (
|
||||
<CleaveReact
|
||||
value="test"
|
||||
className="form-control"
|
||||
options={{ date: true }}
|
||||
onChange={handleChange}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
// Type definitions for cleave.js 1.3
|
||||
// Type definitions for cleave.js 1.4
|
||||
// Project: https://github.com/nosir/cleave.js
|
||||
// Definitions by: C Lentfort <https://github.com/clentfort>,
|
||||
// J Giancono <https://github.com/jasongi-at-sportsbet>,
|
||||
|
||||
Vendored
+7
@@ -3,8 +3,15 @@ import { CleaveOptions } from "../options";
|
||||
|
||||
export type InitHandler = (owner: React.ReactInstance) => void;
|
||||
|
||||
export interface ChangeEvent<T> extends React.ChangeEvent<T> {
|
||||
target: { rawValue: string } & EventTarget & T;
|
||||
}
|
||||
|
||||
export type ChangeEventHandler<T = Element> = React.EventHandler<ChangeEvent<T>>;
|
||||
|
||||
export interface Props extends React.InputHTMLAttributes<HTMLInputElement> {
|
||||
onInit?: InitHandler;
|
||||
options: CleaveOptions;
|
||||
htmlRef?: (i: any) => void;
|
||||
onChange?: ChangeEventHandler<HTMLInputElement>;
|
||||
}
|
||||
|
||||
Vendored
+3
-3
@@ -32,9 +32,9 @@ declare namespace Clusterize {
|
||||
}
|
||||
|
||||
interface Callbacks {
|
||||
clusterWillChange?(cb: () => void): void;
|
||||
clusterChanged?(cb: () => void): void;
|
||||
scrollingProgress?(cb: (progress: number) => void): void;
|
||||
clusterWillChange?: () => void;
|
||||
clusterChanged?: () => void;
|
||||
scrollingProgress?: (progress: number) => void;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ client.getAccount("abcdef", (error: Error, account: coinbase.Account): void => {
|
||||
|
||||
account.getBuy("abcdef", (error: Error, buy: coinbase.Buy): void => undefined);
|
||||
|
||||
account.getBuys((error: Error, buy: coinbase.Buy[]): void => undefined);
|
||||
account.getBuys(null, (error: Error, buy: coinbase.Buy[]): void => undefined);
|
||||
|
||||
account.getDeposit("abcdef", (error: Error, deposit: coinbase.Deposit): void => undefined);
|
||||
|
||||
@@ -33,7 +33,7 @@ client.getAccount("abcdef", (error: Error, account: coinbase.Account): void => {
|
||||
|
||||
account.getSell("abcdef", (error: Error, deposit: coinbase.Sell): void => undefined);
|
||||
|
||||
account.getSells((error: Error, deposit: coinbase.Sell[]): void => undefined);
|
||||
account.getSells(null, (error: Error, deposit: coinbase.Sell[]): void => undefined);
|
||||
|
||||
account.getTransaction("abcdef", (error: Error, deposit: coinbase.Transaction): void => undefined);
|
||||
|
||||
|
||||
Vendored
+64
-3
@@ -536,6 +536,21 @@ export class Account implements Resource {
|
||||
*/
|
||||
balance: MoneyHash;
|
||||
|
||||
/**
|
||||
* Allow deposits
|
||||
*/
|
||||
allow_deposits: boolean;
|
||||
|
||||
/**
|
||||
* Allow withdrawls
|
||||
*/
|
||||
allow_withdrawals: boolean;
|
||||
|
||||
/**
|
||||
* Account worth in fiat.
|
||||
*/
|
||||
native_balance: MoneyHash;
|
||||
|
||||
/**
|
||||
* Promote an account as primary account.
|
||||
* Scope: wallet:accounts:update
|
||||
@@ -630,7 +645,7 @@ export class Account implements Resource {
|
||||
* Lists buys for an account.
|
||||
* Scope: wallet:buys:read
|
||||
*/
|
||||
getBuys(cb: (error: Error, result: Buy[]) => void): void;
|
||||
getBuys(opts: null, cb: (error: Error, result: Buy[]) => void): void;
|
||||
|
||||
/**
|
||||
* Show an individual buy.
|
||||
@@ -663,7 +678,7 @@ export class Account implements Resource {
|
||||
* Lists sells for an account.
|
||||
* Scope: wallet:sells:read
|
||||
*/
|
||||
getSells(cb: (error: Error, result: Sell[]) => void): void;
|
||||
getSells(opts: null, cb: (error: Error, result: Sell[]) => void): void;
|
||||
|
||||
/**
|
||||
* Show an individual sell.
|
||||
@@ -883,7 +898,7 @@ export class Buy implements Resource {
|
||||
/**
|
||||
* Fee associated to this buy
|
||||
*/
|
||||
fee: MoneyHash;
|
||||
fees: Fee[];
|
||||
|
||||
/**
|
||||
* Has this buy been committed?
|
||||
@@ -900,6 +915,26 @@ export class Buy implements Resource {
|
||||
*/
|
||||
payout_at?: string;
|
||||
|
||||
/**
|
||||
* Unit price of the base currency.
|
||||
*/
|
||||
unit_price: UnitPrice;
|
||||
|
||||
/**
|
||||
* Hold period for transfer.
|
||||
*/
|
||||
hold_business_days: number;
|
||||
|
||||
/**
|
||||
* Is it the first buy for this symbol?
|
||||
*/
|
||||
is_first_buy: boolean;
|
||||
|
||||
/**
|
||||
* Is there another action required to make the transfer pass?
|
||||
*/
|
||||
requires_completion_step: boolean;
|
||||
|
||||
/**
|
||||
* Completes a buy that is created in commit: false state.
|
||||
* If the exchange rate has changed since the buy was created, this call will fail with the error “The exchange rate updated while you
|
||||
@@ -910,6 +945,32 @@ export class Buy implements Resource {
|
||||
commit(cb: (error: Error, transaction: Buy) => void): void;
|
||||
}
|
||||
|
||||
export interface Fee {
|
||||
/**
|
||||
* Amount associated to this fee
|
||||
*/
|
||||
amount: MoneyHash;
|
||||
/**
|
||||
* Fee beneficiary ("bank", "coinbase", ...)
|
||||
*/
|
||||
type: string;
|
||||
}
|
||||
|
||||
export interface UnitPrice {
|
||||
/**
|
||||
* Amount as floating-point in a string
|
||||
*/
|
||||
amount: string;
|
||||
/**
|
||||
* Currency e.g. "BTC" (see Client#getCurrencies() for available strings)
|
||||
*/
|
||||
currency: string;
|
||||
/**
|
||||
* Type of price
|
||||
*/
|
||||
scale: number;
|
||||
}
|
||||
|
||||
export type SellStatus = "created" | "completed" | "canceled";
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
import diff from "color-diff";
|
||||
|
||||
const color = { R: 255, G: 1, B: 30 };
|
||||
// red, green, blue
|
||||
const palette = [
|
||||
{ R: 255, G: 0, B: 0 },
|
||||
{ R: 0, G: 255, B: 0 },
|
||||
{ R: 0, G: 0, B: 255 }
|
||||
];
|
||||
|
||||
diff.closest(color, palette); // {R: 255, G: 0, B: 0 }, red
|
||||
|
||||
const color1 = { R: 255, G: 255, B: 255 };
|
||||
// black, white
|
||||
const palette1 = [{ R: 0, G: 0, B: 0 }, { R: 255, G: 255, B: 255 }];
|
||||
|
||||
diff.furthest(color1, palette1); // {R: 0, G: 0, B: 0 }, black
|
||||
Vendored
+67
@@ -0,0 +1,67 @@
|
||||
// Type definitions for color-diff 1.1
|
||||
// Project: https://github.com/markusn/color-diff#readme
|
||||
// Definitions by: katsanva <https://github.com/katsanva>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.7
|
||||
|
||||
export interface RGBColor {
|
||||
R: number;
|
||||
G: number;
|
||||
B: number;
|
||||
A?: number;
|
||||
}
|
||||
|
||||
export interface LabColor {
|
||||
L: number;
|
||||
a: number;
|
||||
b: number;
|
||||
}
|
||||
|
||||
export function diff(c1: LabColor, c2: LabColor): number;
|
||||
|
||||
export function rgb_to_lab(c: RGBColor): LabColor;
|
||||
export function rgba_to_lab(c: RGBColor, bc?: RGBColor): LabColor;
|
||||
|
||||
export function closest(
|
||||
color: RGBColor,
|
||||
palette: ReadonlyArray<RGBColor>,
|
||||
backgroundColor?: RGBColor
|
||||
): RGBColor;
|
||||
|
||||
export function furthest(
|
||||
color: RGBColor,
|
||||
palette: ReadonlyArray<RGBColor>,
|
||||
backgroundColor?: RGBColor
|
||||
): RGBColor;
|
||||
|
||||
export function map_palette(
|
||||
a: ReadonlyArray<RGBColor>,
|
||||
b: ReadonlyArray<RGBColor>,
|
||||
type?: "closest" | "furthest",
|
||||
backgroundColor?: RGBColor
|
||||
): { [key: string]: RGBColor };
|
||||
|
||||
export function palette_map_key(c: RGBColor): string;
|
||||
|
||||
export function closest_lab(
|
||||
color: LabColor,
|
||||
palette: ReadonlyArray<LabColor>
|
||||
): LabColor;
|
||||
|
||||
export function furthest_lab(
|
||||
color: LabColor,
|
||||
palette: ReadonlyArray<LabColor>
|
||||
): LabColor;
|
||||
|
||||
export function map_palette_lab(
|
||||
p1: ReadonlyArray<LabColor>,
|
||||
p2: ReadonlyArray<LabColor>
|
||||
): { [key: string]: LabColor };
|
||||
|
||||
export function lab_palette_map_key(c: LabColor): string;
|
||||
|
||||
export function match_palette_lab(
|
||||
target_color: LabColor,
|
||||
palette: ReadonlyArray<LabColor>,
|
||||
find_furthest: boolean
|
||||
): LabColor;
|
||||
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": ["es6"],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": ["../"],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"esModuleInterop": true,
|
||||
"strictFunctionTypes": true
|
||||
},
|
||||
"files": ["index.d.ts", "color-diff-tests.ts"]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Vendored
+6
-3
@@ -4,15 +4,18 @@
|
||||
// Leonard Thieu <https://github.com/leonard-thieu>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export type NodeType =
|
||||
'text' |'softbreak' | 'linebreak' | 'emph' | 'strong' | 'html_inline' | 'link' | 'image' | 'code' | 'document' | 'paragraph' |
|
||||
'block_quote' | 'item' | 'list' | 'heading' | 'code_block' | 'html_block' | 'thematic_break' | 'custom_inline' | 'custom_block';
|
||||
|
||||
export class Node {
|
||||
constructor(nodeType: string, sourcepos?: Position);
|
||||
constructor(nodeType: NodeType, sourcepos?: Position);
|
||||
|
||||
/**
|
||||
* (read-only): a String, one of text, softbreak, linebreak, emph, strong, html_inline, link, image, code, document, paragraph,
|
||||
* block_quote, item, list, heading, code_block, html_block, thematic_break.
|
||||
*/
|
||||
readonly type: 'text' | 'softbreak' | 'linebreak' | 'emph' | 'strong' | 'html_inline' | 'link' | 'image' | 'code' | 'document' | 'paragraph' |
|
||||
'block_quote' | 'item' | 'list' | 'heading' | 'code_block' | 'html_block' | 'thematic_break' | 'custom_inline' | 'custom_block';
|
||||
readonly type: NodeType;
|
||||
/**
|
||||
* (read-only): a Node or null.
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
import { format, parse } from 'content-range';
|
||||
|
||||
format({
|
||||
first: 10,
|
||||
last: 100,
|
||||
length: 100,
|
||||
limit: 20,
|
||||
unit: 'items',
|
||||
});
|
||||
|
||||
format({
|
||||
length: null,
|
||||
unit: 'bytes',
|
||||
});
|
||||
|
||||
const parts = parse('items 10-29/100');
|
||||
|
||||
if (parts) {
|
||||
parts.first;
|
||||
parts.last;
|
||||
parts.length;
|
||||
parts.unit;
|
||||
}
|
||||
Vendored
+22
@@ -0,0 +1,22 @@
|
||||
// Type definitions for content-range 1.1
|
||||
// Project: https://github.com/neoziro/content-range
|
||||
// Definitions by: Alex Brick <https://github.com/bricka>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export interface ContentRangeFormatOptions {
|
||||
first?: number;
|
||||
last?: number;
|
||||
length: number | null;
|
||||
limit?: number;
|
||||
unit: string;
|
||||
}
|
||||
|
||||
export interface ContentRangeParts {
|
||||
first: number | null;
|
||||
last: number | null;
|
||||
length: number | null;
|
||||
unit: string;
|
||||
}
|
||||
|
||||
export function format(options: ContentRangeFormatOptions): string;
|
||||
export function parse(str: string): ContentRangeParts | null;
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"content-range-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Vendored
+53
-6
@@ -7,10 +7,41 @@
|
||||
import File = require('vinyl');
|
||||
|
||||
declare namespace copy {
|
||||
function each(files: string[], dir: string, options: Options, callback: Callback): void;
|
||||
function each(files: string[], dir: string, callback: Callback): void;
|
||||
function one(pattern: string | object, dir: string, options: Options, callback: Callback): void;
|
||||
function one(pattern: string | object, dir: string, callback: Callback): void;
|
||||
/**
|
||||
* Copy an array of files to the given destination `directory`, with
|
||||
* `options` and callback function that exposes `err` and the array of
|
||||
* vinyl files that are created by the copy operation.
|
||||
*
|
||||
* ```js
|
||||
* copy.each(['foo.txt', 'bar.txt', 'baz.txt'], 'dist', function(err, files) {
|
||||
* // exposes the vinyl `files` created when the files are copied
|
||||
* });
|
||||
* ```
|
||||
* @param `files` Filepaths or vinyl files.
|
||||
* @param `dir` Destination directory
|
||||
* @param `options` or callback function
|
||||
* @param `cb` Callback function if no options are specified
|
||||
*/
|
||||
function each(files: string[] | File[], dir: string, options: Options, cb: Callback): void;
|
||||
function each(files: string[] | File[], dir: string, cb: Callback): void;
|
||||
|
||||
/**
|
||||
* Copy a single `file` to the given `dest` directory, using
|
||||
* the specified options and callback function.
|
||||
*
|
||||
* ```js
|
||||
* copy.one('foo.txt', 'dist', function(err, file) {
|
||||
* if (err) throw err;
|
||||
* // exposes the vinyl `file` that is created when the file is copied
|
||||
* });
|
||||
* ```
|
||||
* @param `file` Filepath or vinyl file
|
||||
* @param `dir` Destination directory
|
||||
* @param `options` or callback function
|
||||
* @param `cb` Callback function if no options are specified
|
||||
*/
|
||||
function one(pattern: string | File, dir: string, options: Options, cb: Callback): void;
|
||||
function one(pattern: string | File, dir: string, cb: Callback): void;
|
||||
|
||||
type Callback = (error: Error | null, files?: File[]) => void;
|
||||
|
||||
@@ -20,12 +51,28 @@ declare namespace copy {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy a filepath, vinyl file, array of files, or glob of files to the
|
||||
* given destination `directory`, with `options` and callback function that
|
||||
* exposes `err` and the array of vinyl files that are created by the copy
|
||||
* operation.
|
||||
*
|
||||
* ```js
|
||||
* copy('*.js', 'dist', function(err, file) {
|
||||
* // exposes the vinyl `file` created when the file is copied
|
||||
* });
|
||||
* ```
|
||||
* @param `patterns` Filepath(s), vinyl file(s) or glob of files.
|
||||
* @param `dir` Destination directory
|
||||
* @param `options` or callback function
|
||||
* @param `cb` Callback function if no options are specified
|
||||
*/
|
||||
declare function copy(
|
||||
patterns: string | object | string[],
|
||||
patterns: string | File | string[] | File[],
|
||||
dir: string,
|
||||
options: copy.Options,
|
||||
callback: copy.Callback,
|
||||
): void;
|
||||
declare function copy(patterns: string | object | string[], dir: string, callback: copy.Callback): void;
|
||||
declare function copy(patterns: string | File | string[] | File[], dir: string, callback: copy.Callback): void;
|
||||
|
||||
export = copy;
|
||||
|
||||
Vendored
+19
-8
@@ -1,4 +1,4 @@
|
||||
// Type definitions for cron 1.3
|
||||
// Type definitions for cron 1.6
|
||||
// Project: https://www.npmjs.com/package/cron
|
||||
// Definitions by: Hiroki Horiuchi <https://github.com/horiuchi>
|
||||
// Lundarl Gholoi <https://github.com/winup>
|
||||
@@ -9,8 +9,9 @@ export declare class CronTime {
|
||||
* Create a new ```CronTime```.
|
||||
* @param source The time to fire off your job. This can be in the form of cron syntax or a JS ```Date``` object.
|
||||
* @param zone Timezone name. You can check all timezones available at [Moment Timezone Website](http://momentjs.com/timezone/).
|
||||
* @param utcOffset UTC offset. Don't use both ```zone``` and ```utcOffset``` together or weird things may happen.
|
||||
*/
|
||||
constructor(source: string | Date, zone?: string);
|
||||
constructor(source: string | Date, zone?: string, utcOffset?: string | number);
|
||||
|
||||
/**
|
||||
* Tells you when ```CronTime``` will be run.
|
||||
@@ -29,19 +30,19 @@ export declare interface CronJobParameters {
|
||||
*/
|
||||
cronTime: string | Date;
|
||||
/**
|
||||
* The function to fire at the specified time.
|
||||
* The function to fire at the specified time. If an ```onComplete``` callback was provided, ```onTick``` will receive it as an argument. ```onTick``` may call ```onComplete``` when it has finished its work.
|
||||
*/
|
||||
onTick: () => void;
|
||||
/**
|
||||
* A function that will fire when the job is complete, when it is stopped.
|
||||
* A function that will fire when the job is stopped with ```job.stop()```, and may also be called by ```onTick``` at the end of each run.
|
||||
*/
|
||||
onComplete?: () => void;
|
||||
/**
|
||||
* Specifies whether to start the job just before exiting the constructor. By default this is set to false. If left at default you will need to call ```job.start()``` in order to start the job (assuming ```job``` is the variable you set the cronjob to). This does not immediately fire your onTick function, it just gives you more control over the behavior of your jobs.
|
||||
* Specifies whether to start the job just before exiting the constructor. By default this is set to false. If left at default you will need to call ```job.start()``` in order to start the job (assuming ```job``` is the variable you set the cronjob to). This does not immediately fire your ```onTick``` function, it just gives you more control over the behavior of your jobs.
|
||||
*/
|
||||
start?: boolean;
|
||||
/**
|
||||
* Specify the timezone for the execution. This will modify the actual time relative to your timezone. If the timezone is invalid, an error is thrown. You can check all timezones available at [Moment Timezone Website](http://momentjs.com/timezone/).
|
||||
* Specify the timezone for the execution. This will modify the actual time relative to your timezone. If the timezone is invalid, an error is thrown. You can check all timezones available at [Moment Timezone Website](http://momentjs.com/timezone/). Probably don't use both ```timeZone``` and ```utcOffset``` together or weird things may happen.
|
||||
*/
|
||||
timeZone?: string;
|
||||
/**
|
||||
@@ -52,6 +53,14 @@ export declare interface CronJobParameters {
|
||||
* This will immediately fire your ```onTick``` function as soon as the requisit initialization has happened. This option is set to ```false``` by default for backwards compatibility.
|
||||
*/
|
||||
runOnInit?: boolean;
|
||||
/**
|
||||
* This allows you to specify the offset of your timezone rather than using the ```timeZone``` param. Probably don't use both ```timeZone``` and ```utcOffset``` together or weird things may happen.
|
||||
*/
|
||||
utcOffset?: string | number;
|
||||
/**
|
||||
* If you have code that keeps the event loop running and want to stop the node process when that finishes regardless of the state of your cronjob, you can do so making use of this parameter. This is off by default and cron will run as if it needs to control the event loop. For more information take a look at [timers#timers_timeout_unref](https://nodejs.org/api/timers.html#timers_timeout_unref) from the NodeJS docs.
|
||||
*/
|
||||
unrefTimeout?: boolean;
|
||||
}
|
||||
|
||||
export declare class CronJob {
|
||||
@@ -73,8 +82,10 @@ export declare class CronJob {
|
||||
* @param timeZone Specify the timezone for the execution. This will modify the actual time relative to your timezone. If the timezone is invalid, an error is thrown. You can check all timezones available at [Moment Timezone Website](http://momentjs.com/timezone/).
|
||||
* @param context The context within which to execute the onTick method. This defaults to the cronjob itself allowing you to call ```this.stop()```. However, if you change this you'll have access to the functions and values within your context object.
|
||||
* @param runOnInit This will immediately fire your ```onTick``` function as soon as the requisit initialization has happened. This option is set to ```false``` by default for backwards compatibility.
|
||||
* @param utcOffset This allows you to specify the offset of your timezone rather than using the ```timeZone``` param. Probably don't use both ```timeZone``` and ```utcOffset``` together or weird things may happen.
|
||||
* @param unrefTimeout If you have code that keeps the event loop running and want to stop the node process when that finishes regardless of the state of your cronjob, you can do so making use of this parameter. This is off by default and cron will run as if it needs to control the event loop. For more information take a look at [timers#timers_timeout_unref](https://nodejs.org/api/timers.html#timers_timeout_unref) from the NodeJS docs.
|
||||
*/
|
||||
constructor(cronTime: string | Date, onTick: () => void, onComplete?: () => void, start?: boolean, timeZone?: string, context?: any, runOnInit?: boolean);
|
||||
constructor(cronTime: string | Date, onTick: () => void, onComplete?: () => void, start?: boolean, timeZone?: string, context?: any, runOnInit?: boolean, utcOffset?: string | number, unrefTimeout?: boolean);
|
||||
/**
|
||||
* Create a new ```CronJob```.
|
||||
* @param options Job parameters.
|
||||
@@ -111,7 +122,7 @@ export declare class CronJob {
|
||||
}
|
||||
|
||||
export declare var job:
|
||||
((cronTime: string | Date, onTick: () => void, onComplete?: () => void, start?: boolean, timeZone?: string, context?: any, runOnInit?: boolean) => CronJob)
|
||||
((cronTime: string | Date, onTick: () => void, onComplete?: () => void, start?: boolean, timeZone?: string, context?: any, runOnInit?: boolean, utcOffset?: string | number, unrefTimeout?: boolean) => CronJob)
|
||||
| ((options: CronJobParameters) => CronJob);
|
||||
export declare var time: (source: string | Date, zone?: string) => CronTime;
|
||||
export declare var sendAt: (cronTime: CronTime) => Date;
|
||||
|
||||
@@ -10,17 +10,20 @@ CustomFunctions.associate({
|
||||
RANDOM: (n: number) => n * Math.random()
|
||||
});
|
||||
|
||||
function callerAddress(invocation: CustomFunctions.Invocation) {
|
||||
return invocation.address;
|
||||
}
|
||||
|
||||
async function getStockValues(ticker: string): Promise<number> {
|
||||
const response = await fetch(`myService.com/prices/${ticker}`);
|
||||
return (await response.json())["price"];
|
||||
}
|
||||
|
||||
async function getStockValuesCancellable(
|
||||
ticker: string,
|
||||
handler: CustomFunctions.CancelableHandler
|
||||
): Promise<number> {
|
||||
async function getStockValuesCancellable(ticker: string,
|
||||
invocation: CustomFunctions.CancelableInvocation): Promise<number> {
|
||||
const address = invocation.address;
|
||||
let shouldStop = false;
|
||||
handler.onCanceled = () => (shouldStop = true);
|
||||
invocation.onCanceled = () => (shouldStop = true);
|
||||
await pause(1000);
|
||||
|
||||
if (shouldStop) {
|
||||
@@ -31,10 +34,9 @@ async function getStockValuesCancellable(
|
||||
return (await response.json())["price"];
|
||||
}
|
||||
|
||||
function stockPriceStream(
|
||||
ticker: string,
|
||||
handler: CustomFunctions.StreamingHandler<number>
|
||||
) {
|
||||
function stockPriceStream(ticker: string,
|
||||
invocation: CustomFunctions.StreamingInvocation<number>) {
|
||||
const address = invocation.address;
|
||||
const updateFrequency = 10 /* milliseconds*/;
|
||||
let isPending = false;
|
||||
|
||||
@@ -49,14 +51,14 @@ function stockPriceStream(
|
||||
try {
|
||||
const response = await fetch(url);
|
||||
const data = await response.json();
|
||||
handler.setResult(data.price);
|
||||
invocation.setResult(data.price);
|
||||
} catch (error) {
|
||||
handler.setResult(error);
|
||||
invocation.setResult(error);
|
||||
}
|
||||
isPending = false;
|
||||
}, updateFrequency);
|
||||
|
||||
handler.onCanceled = () => {
|
||||
invocation.onCanceled = () => {
|
||||
clearInterval(timer);
|
||||
};
|
||||
}
|
||||
|
||||
+53
-13
@@ -1,6 +1,9 @@
|
||||
// Type definitions for Custom Functions 1.4
|
||||
// Project: https://github.com/OfficeDev/office-js
|
||||
// Definitions by: OfficeDev <https://github.com/OfficeDev>, Michael Zlatkovsky <https://github.com/Zlatkovsky>, Michelle Scharlock <https://github.com/mscharlock>
|
||||
// Definitions by: OfficeDev <https://github.com/OfficeDev>,
|
||||
// Adam Krantz <https://github.com/akrantz>,
|
||||
// Michael Zlatkovsky <https://github.com/Zlatkovsky>,
|
||||
// Michelle Scharlock <https://github.com/mscharlock>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.4
|
||||
|
||||
@@ -10,8 +13,8 @@ Copyright (c) Microsoft Corporation
|
||||
*/
|
||||
|
||||
/**
|
||||
* CustomFunctions namespace, used by Excel Custom Functions
|
||||
* @beta
|
||||
* CustomFunctions namespace, used by Excel Custom Functions
|
||||
*/
|
||||
declare namespace CustomFunctions {
|
||||
/**
|
||||
@@ -26,30 +29,67 @@ declare namespace CustomFunctions {
|
||||
function associate(mappings: { [key: string]: Function }): void;
|
||||
|
||||
/**
|
||||
* A handler passed automatically as the last parameter
|
||||
* to a streaming function. With this parameter, a
|
||||
* function can use handler.setResult to set a cell value
|
||||
* or hook into the handler.onCanceled event to
|
||||
* to handle what happens when the function stops streaming.
|
||||
* @beta
|
||||
* Provides information about the invocation of a custom function.
|
||||
*/
|
||||
interface StreamingHandler<T> extends CancelableHandler {
|
||||
interface Invocation {
|
||||
/**
|
||||
* Sets the returned result for a streaming custom function.
|
||||
* @beta
|
||||
* The cell address where the function is being called, if requested, otherwise undefined.
|
||||
*
|
||||
* To request the address for the function, in the metadata JSON file, the function options should specify:
|
||||
* `{ "requiresAddress": true }`
|
||||
*
|
||||
* If the metadata JSON file is being generated from JSDoc comments, include the tag `@requiresAddress`.
|
||||
*/
|
||||
setResult: (value: T | Error) => void;
|
||||
address?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @beta
|
||||
* CancelableHandler interface
|
||||
* Provides information about the invocation of a cancelable custom function.
|
||||
* A cancelable custom function can provide a handler for the onCanceled event.
|
||||
*
|
||||
* To indicate that a function is cancelable, in the metadata JSON file, the function options should specify:
|
||||
* `{ "cancelable": true }`
|
||||
*
|
||||
* If the metadata JSON file is being generated from JSDoc comments, include the tag `@cancelable`.
|
||||
*/
|
||||
interface CancelableHandler {
|
||||
interface CancelableInvocation extends Invocation {
|
||||
/**
|
||||
* Handles what should occur when a custom function is canceled.
|
||||
* @beta
|
||||
* Event handler called when the custom function is canceled.
|
||||
*/
|
||||
onCanceled: () => void;
|
||||
}
|
||||
|
||||
/**
|
||||
* @beta
|
||||
* @deprecated Use `CancelableInvocation` instead.
|
||||
*/
|
||||
interface CancelableHandler extends CancelableInvocation {
|
||||
}
|
||||
|
||||
/**
|
||||
* @beta
|
||||
* Provides information about the invocation of a streaming custom function.
|
||||
* A streaming custom function can provide results which can change over time.
|
||||
*
|
||||
* Call `setResult()` one or more times to provide the result instead of returning
|
||||
* a result from the function.
|
||||
*/
|
||||
interface StreamingInvocation<ResultType> extends CancelableInvocation {
|
||||
/**
|
||||
* @beta
|
||||
* Set the result for the custom function. May be called more than once.
|
||||
*/
|
||||
setResult: (value: ResultType | Error) => void;
|
||||
}
|
||||
|
||||
/**
|
||||
* @beta
|
||||
* @deprecated Use `StreamingInvocation<ResultType>` instead.
|
||||
*/
|
||||
interface StreamingHandler<ResultType> extends StreamingInvocation<ResultType> {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"ban-types": false,
|
||||
"file-name-casing": false
|
||||
"file-name-casing": false,
|
||||
"no-empty-interface": false
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -181,7 +181,7 @@ export function ascending(a: Primitive | undefined, b: Primitive | undefined): n
|
||||
|
||||
// NB. this is limited to primitive values due to D3's use of the <, >, and >= operators. Results get weird for object instances.
|
||||
/**
|
||||
* Compares two primitive values for sorting (in ascending order).
|
||||
* Compares two primitive values for sorting (in descending order).
|
||||
*/
|
||||
export function descending(a: Primitive | undefined, b: Primitive | undefined): number;
|
||||
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
import defaults = require('defaults-deep');
|
||||
|
||||
defaults();
|
||||
defaults({a: 'foo'});
|
||||
defaults({a: 'foo'}, {a: 'bar'});
|
||||
defaults({a: 'foo'}, {a: 'bar'}, {a: 'foobar'});
|
||||
defaults({a: {b: 'foo'}}, {a: {b: 'bar'}});
|
||||
Vendored
+12
@@ -0,0 +1,12 @@
|
||||
// Type definitions for defaults-deep 0.2
|
||||
// Project: https://github.com/jonschlinkert/defaults-deep
|
||||
// Definitions by: Hugo Alliaume <https://github.com/Kocal>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
interface Obj {
|
||||
[k: string]: any;
|
||||
}
|
||||
|
||||
declare function defaultsDeep(...objs: Obj[]): Obj;
|
||||
|
||||
export = defaultsDeep;
|
||||
@@ -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",
|
||||
"defaults-deep-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Vendored
+3
-3
@@ -1455,13 +1455,13 @@ interface GanttStatic {
|
||||
* exports a Gantt chart into the PDF format
|
||||
* @param _export_ an object with export settings (see the details)
|
||||
*/
|
||||
exportToPDF(_export_: any): void;
|
||||
exportToPDF(_export_?: any): void;
|
||||
|
||||
/**
|
||||
* exports a Gantt chart into the PNG format
|
||||
* @param _export_ an object with export settings (see the details)
|
||||
*/
|
||||
exportToPNG(_export_: any): void;
|
||||
exportToPNG(_export_?: any): void;
|
||||
|
||||
/**
|
||||
* returns all dependency loops in the chart
|
||||
@@ -2242,4 +2242,4 @@ declare module "gantt" {
|
||||
|
||||
declare module "Gantt" {
|
||||
export = Gantt;
|
||||
}
|
||||
}
|
||||
|
||||
+71
-72
@@ -1,47 +1,55 @@
|
||||
import jsdiff = require('diff');
|
||||
import * as diff from 'diff';
|
||||
|
||||
const one = 'beep boop';
|
||||
const other = 'beep boob blah';
|
||||
|
||||
let diff = jsdiff.diffChars(one, other);
|
||||
printDiff(diff);
|
||||
let changes = diff.diffChars(one, other);
|
||||
examineChanges(changes);
|
||||
|
||||
const diffArraysResult = jsdiff.diffArrays<string>(['a', 'b', 'c'], ['a', 'c', 'd']);
|
||||
// $ExpectType void
|
||||
diff.diffChars(one, other, {
|
||||
callback: (err, value) => {
|
||||
err; // $ExpectType undefined
|
||||
value; // $ExpectType Change[] | undefined
|
||||
},
|
||||
});
|
||||
// $ExpectType void
|
||||
diff.diffChars(one, other, (err, value) => {
|
||||
err; // $ExpectType undefined
|
||||
value; // $ExpectType Change[] | undefined
|
||||
});
|
||||
|
||||
const diffArraysResult = diff.diffArrays(['a', 'b', 'c'], ['a', 'c', 'd']);
|
||||
diffArraysResult.forEach(result => {
|
||||
if (result.added) {
|
||||
console.log(`added ${result.value.length} line(s):`, ...result.value);
|
||||
} else if (result.removed) {
|
||||
console.log(`removed ${result.value.length} line(s):`, ...result.value);
|
||||
} else {
|
||||
console.log(`no changes`);
|
||||
}
|
||||
result.added; // $ExpectType boolean | undefined
|
||||
result.removed; // $ExpectType boolean | undefined
|
||||
result.value; // $ExpectType string[]
|
||||
result.count; // $ExpectType number | undefined
|
||||
});
|
||||
|
||||
interface DiffObj {
|
||||
value: number;
|
||||
}
|
||||
const a: DiffObj = {value: 0};
|
||||
const b: DiffObj = {value: 1};
|
||||
const c: DiffObj = {value: 2};
|
||||
const d: DiffObj = {value: 3};
|
||||
const arrayOptions: jsdiff.IArrayOptions = {
|
||||
comparator: (left: DiffObj, right: DiffObj) => {
|
||||
return left.value === right.value;
|
||||
}
|
||||
const a: DiffObj = { value: 0 };
|
||||
const b: DiffObj = { value: 1 };
|
||||
const c: DiffObj = { value: 2 };
|
||||
const d: DiffObj = { value: 3 };
|
||||
const arrayOptions: diff.ArrayOptions<DiffObj, DiffObj> = {
|
||||
comparator: (left, right) => {
|
||||
return left.value === right.value;
|
||||
},
|
||||
};
|
||||
const diffResult = jsdiff.diffArrays([a, b, c], [a, b, d], arrayOptions);
|
||||
diffResult.forEach(result => {
|
||||
if (result.added) {
|
||||
console.log(`added ${result.value.length} line(s):`, ...result.value);
|
||||
} else if (result.removed) {
|
||||
console.log(`removed ${result.value.length} line(s):`, ...result.value);
|
||||
} else {
|
||||
console.log(`no changes`);
|
||||
}
|
||||
const arrayChanges = diff.diffArrays([a, b, c], [a, b, d], arrayOptions);
|
||||
arrayChanges.forEach(result => {
|
||||
result.added; // $ExpectType boolean | undefined
|
||||
result.removed; // $ExpectType boolean | undefined
|
||||
result.value; // $ExpectType DiffObj[]
|
||||
result.count; // $ExpectType number | undefined
|
||||
});
|
||||
|
||||
// --------------------------
|
||||
|
||||
class LineDiffWithoutWhitespace extends jsdiff.Diff {
|
||||
class LineDiffWithoutWhitespace extends diff.Diff {
|
||||
tokenize(value: string): any {
|
||||
return value.split(/^/m);
|
||||
}
|
||||
@@ -52,71 +60,62 @@ class LineDiffWithoutWhitespace extends jsdiff.Diff {
|
||||
}
|
||||
|
||||
const obj = new LineDiffWithoutWhitespace();
|
||||
diff = obj.diff(one, other);
|
||||
printDiff(diff);
|
||||
changes = obj.diff(one, other);
|
||||
examineChanges(changes);
|
||||
|
||||
function printDiff(diff: jsdiff.IDiffResult[]) {
|
||||
function addLineHeader(decorator: string, str: string | string[]) {
|
||||
return (typeof str === 'string' ? str.split("\n") : str).map((line, index, array) => {
|
||||
if (index === array.length - 1 && line === "") {
|
||||
return line;
|
||||
} else {
|
||||
return decorator + line;
|
||||
}
|
||||
}).join("\n");
|
||||
}
|
||||
|
||||
diff.forEach((part) => {
|
||||
if (part.added) {
|
||||
console.log(addLineHeader("+", part.value));
|
||||
} else if (part.removed) {
|
||||
console.log(addLineHeader("-", part.value));
|
||||
} else {
|
||||
console.log(addLineHeader(" ", part.value));
|
||||
}
|
||||
function examineChanges(diff: diff.Change[]) {
|
||||
diff.forEach(part => {
|
||||
part.added; // $ExpectType boolean | undefined
|
||||
part.removed; // $ExpectType boolean | undefined
|
||||
part.value; // $ExpectType string
|
||||
part.count; // $ExpectType number | undefined
|
||||
});
|
||||
}
|
||||
|
||||
function verifyPatchMethods(oldStr: string, newStr: string, uniDiff: jsdiff.IUniDiff) {
|
||||
const verifyPatch = jsdiff.parsePatch(
|
||||
jsdiff.createTwoFilesPatch("oldFile.ts", "newFile.ts", oldStr, newStr,
|
||||
"old", "new", { context: 1 }));
|
||||
function verifyPatchMethods(oldStr: string, newStr: string, uniDiff: diff.ParsedDiff) {
|
||||
const verifyPatch = diff.parsePatch(
|
||||
diff.createTwoFilesPatch('oldFile.ts', 'newFile.ts', oldStr, newStr, 'old', 'new', {
|
||||
context: 1,
|
||||
})
|
||||
);
|
||||
|
||||
if (JSON.stringify(verifyPatch[0], Object.keys(verifyPatch[0]).sort()) !== JSON.stringify(uniDiff, Object.keys(uniDiff).sort())) {
|
||||
console.error("Patch did not match uniDiff");
|
||||
if (
|
||||
JSON.stringify(verifyPatch[0], Object.keys(verifyPatch[0]).sort()) !==
|
||||
JSON.stringify(uniDiff, Object.keys(uniDiff).sort())
|
||||
) {
|
||||
throw new Error('Patch did not match uniDiff');
|
||||
}
|
||||
}
|
||||
function verifyApplyMethods(oldStr: string, newStr: string, uniDiff: jsdiff.IUniDiff) {
|
||||
const verifyApply = [
|
||||
jsdiff.applyPatch(oldStr, uniDiff),
|
||||
jsdiff.applyPatch(oldStr, [uniDiff])
|
||||
];
|
||||
jsdiff.applyPatches([uniDiff], {
|
||||
loadFile: (index: number, callback: (err: Error, data: string) => void) => {
|
||||
function verifyApplyMethods(oldStr: string, newStr: string, uniDiff: diff.ParsedDiff) {
|
||||
const verifyApply = [diff.applyPatch(oldStr, uniDiff), diff.applyPatch(oldStr, [uniDiff])];
|
||||
diff.applyPatches([uniDiff], {
|
||||
loadFile: (index, callback) => {
|
||||
index; // $ExpectType ParsedDiff
|
||||
callback(undefined, one);
|
||||
},
|
||||
patched: (index: number, content: string) => {
|
||||
patched: (index, content) => {
|
||||
index; // $ExpectType ParsedDiff
|
||||
verifyApply.push(content);
|
||||
},
|
||||
complete: (err?: Error) => {
|
||||
if (err) {
|
||||
console.error(err);
|
||||
throw err;
|
||||
}
|
||||
|
||||
verifyApply.forEach(result => {
|
||||
if (result !== newStr) {
|
||||
console.error("Result did not match newStr");
|
||||
throw new Error('Result did not match newStr');
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
const uniDiffPatch = jsdiff.structuredPatch("oldFile.ts", "newFile.ts", one, other,
|
||||
"old", "new", { context: 1 });
|
||||
const uniDiffPatch = diff.structuredPatch('oldFile.ts', 'newFile.ts', one, other, 'old', 'new', {
|
||||
context: 1,
|
||||
});
|
||||
verifyPatchMethods(one, other, uniDiffPatch);
|
||||
|
||||
const uniDiffStr = jsdiff.createPatch("file.ts", one, other, "old", "new",
|
||||
{ context: 1 });
|
||||
const uniDiffApply = jsdiff.parsePatch(uniDiffStr)[0];
|
||||
const uniDiffStr = diff.createPatch('file.ts', one, other, 'old', 'new', { context: 1 });
|
||||
const uniDiffApply = diff.parsePatch(uniDiffStr)[0];
|
||||
verifyApplyMethods(one, other, uniDiffApply);
|
||||
|
||||
Vendored
+392
-111
@@ -1,121 +1,402 @@
|
||||
// Type definitions for diff 3.5
|
||||
// Type definitions for diff 4.0
|
||||
// Project: https://github.com/kpdecker/jsdiff
|
||||
// Definitions by: vvakame <https://github.com/vvakame>
|
||||
// szdc <https://github.com/szdc>
|
||||
// moc-yuto <https://github.com/moc-yuto>
|
||||
// BendingBender <https://github.com/BendingBender>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
export = JsDiff;
|
||||
export as namespace JsDiff;
|
||||
export as namespace Diff;
|
||||
|
||||
declare namespace JsDiff {
|
||||
interface IOptions {
|
||||
ignoreCase: boolean;
|
||||
}
|
||||
export type Callback = (err: undefined, value?: Change[]) => void;
|
||||
|
||||
interface ILinesOptions extends IOptions {
|
||||
ignoreWhitespace?: boolean;
|
||||
newlineIsToken?: boolean;
|
||||
}
|
||||
|
||||
interface IArrayOptions {
|
||||
comparator?: (left: any, right: any) => boolean;
|
||||
}
|
||||
|
||||
interface IDiffResult {
|
||||
value: string;
|
||||
count?: number;
|
||||
added?: boolean;
|
||||
removed?: boolean;
|
||||
}
|
||||
|
||||
interface IDiffArraysResult<T> {
|
||||
value: T[];
|
||||
count?: number;
|
||||
added?: boolean;
|
||||
removed?: boolean;
|
||||
}
|
||||
|
||||
interface IBestPath {
|
||||
newPos: number;
|
||||
componenets: IDiffResult[];
|
||||
}
|
||||
|
||||
interface IHunk {
|
||||
oldStart: number;
|
||||
oldLines: number;
|
||||
newStart: number;
|
||||
newLines: number;
|
||||
lines: string[];
|
||||
}
|
||||
|
||||
interface IUniDiff {
|
||||
oldFileName: string;
|
||||
newFileName: string;
|
||||
oldHeader: string;
|
||||
newHeader: string;
|
||||
index: string;
|
||||
hunks: IHunk[];
|
||||
}
|
||||
|
||||
class Diff {
|
||||
diff(oldString: string, newString: string, options?: IOptions): IDiffResult[];
|
||||
|
||||
pushComponent(components: IDiffResult[], added: boolean, removed: boolean): void;
|
||||
|
||||
extractCommon(basePath: IBestPath, newString: string, oldString: string, diagonalPath: number): number;
|
||||
|
||||
equals(left: string, right: string): boolean;
|
||||
|
||||
removeEmpty(array: any[]): any[];
|
||||
|
||||
castInput(value: any): any;
|
||||
|
||||
join(chars: string[]): string;
|
||||
|
||||
tokenize(value: string): any; // return types are string or string[]
|
||||
}
|
||||
|
||||
function diffChars(oldStr: string, newStr: string, options?: IOptions): IDiffResult[];
|
||||
|
||||
function diffWords(oldStr: string, newStr: string, options?: IOptions): IDiffResult[];
|
||||
|
||||
function diffWordsWithSpace(oldStr: string, newStr: string, options?: IOptions): IDiffResult[];
|
||||
|
||||
function diffJson(oldObj: object, newObj: object, options?: IOptions): IDiffResult[];
|
||||
|
||||
function diffLines(oldStr: string, newStr: string, options?: ILinesOptions): IDiffResult[];
|
||||
|
||||
function diffCss(oldStr: string, newStr: string, options?: IOptions): IDiffResult[];
|
||||
|
||||
function diffTrimmedLines(oldStr: string, newStr: string, options?: ILinesOptions): IDiffResult[];
|
||||
|
||||
function diffSentences(oldStr: string, newStr: string, options?: IOptions): IDiffResult[];
|
||||
|
||||
function diffArrays<T>(oldArr: T[], newArr: T[], options?: IArrayOptions): Array<IDiffArraysResult<T>>;
|
||||
|
||||
function createPatch(fileName: string, oldStr: string, newStr: string, oldHeader: string, newHeader: string, options?: {context: number}): string;
|
||||
|
||||
function createTwoFilesPatch(oldFileName: string, newFileName: string, oldStr: string, newStr: string, oldHeader: string, newHeader: string, options?: {context: number}): string;
|
||||
|
||||
function structuredPatch(oldFileName: string, newFileName: string, oldStr: string, newStr: string, oldHeader: string, newHeader: string, options?: {context: number}): IUniDiff;
|
||||
|
||||
function applyPatch(oldStr: string, uniDiff: string | IUniDiff | IUniDiff[]): string;
|
||||
|
||||
function applyPatches(uniDiff: IUniDiff[], options: {
|
||||
loadFile(index: number, callback: (err: Error, data: string) => void): void,
|
||||
patched(index: number, content: string): void,
|
||||
complete(err?: Error): void
|
||||
}): void;
|
||||
|
||||
function parsePatch(diffStr: string, options?: {strict: boolean}): IUniDiff[];
|
||||
|
||||
function convertChangesToXML(changes: IDiffResult[]): string;
|
||||
|
||||
function convertChangesToDMP(changes: IDiffResult[]): Array<{0: number; 1: string; }>;
|
||||
|
||||
function merge(mine: string, theirs: string, base: string): IUniDiff;
|
||||
|
||||
function canonicalize(obj: any, stack: any[], replacementStack: any[]): any;
|
||||
export interface CallbackOptions {
|
||||
/**
|
||||
* Callback to call with the result instead of returning the result directly.
|
||||
*/
|
||||
callback: Callback;
|
||||
}
|
||||
|
||||
export interface BaseOptions {
|
||||
/**
|
||||
* `true` to ignore casing difference.
|
||||
* @default false
|
||||
*/
|
||||
ignoreCase?: boolean;
|
||||
}
|
||||
|
||||
export interface WordsOptions extends BaseOptions {
|
||||
/**
|
||||
* `true` to ignore leading and trailing whitespace. This is the same as `diffWords()`.
|
||||
*/
|
||||
ignoreWhitespace?: boolean;
|
||||
}
|
||||
|
||||
export interface LinesOptions extends BaseOptions {
|
||||
/**
|
||||
* `true` to ignore leading and trailing whitespace. This is the same as `diffTrimmedLines()`.
|
||||
*/
|
||||
ignoreWhitespace?: boolean;
|
||||
|
||||
/**
|
||||
* `true` to treat newline characters as separate tokens. This allows for changes to the newline structure
|
||||
* to occur independently of the line content and to be treated as such. In general this is the more
|
||||
* human friendly form of `diffLines()` and `diffLines()` is better suited for patches and other computer
|
||||
* friendly output.
|
||||
*/
|
||||
newlineIsToken?: boolean;
|
||||
}
|
||||
|
||||
export interface JsonOptions extends LinesOptions {
|
||||
/**
|
||||
* Replacer used to stringify the properties of the passed objects.
|
||||
*/
|
||||
stringifyReplacer?: (key: string, value: any) => any;
|
||||
|
||||
/**
|
||||
* The value to use when `undefined` values in the passed objects are encountered during stringification.
|
||||
* Will only be used if `stringifyReplacer` option wasn't specified.
|
||||
* @default undefined
|
||||
*/
|
||||
undefinedReplacement?: any;
|
||||
}
|
||||
|
||||
export interface ArrayOptions<TLeft, TRight> extends BaseOptions {
|
||||
/**
|
||||
* Comparator for custom equality checks.
|
||||
*/
|
||||
comparator?: (left: TLeft, right: TRight) => boolean;
|
||||
}
|
||||
|
||||
export interface PatchOptions extends LinesOptions {
|
||||
/**
|
||||
* Describes how many lines of context should be included.
|
||||
* @default 4
|
||||
*/
|
||||
context?: number;
|
||||
}
|
||||
|
||||
export interface ApplyPatchOptions {
|
||||
/**
|
||||
* Number of lines that are allowed to differ before rejecting a patch.
|
||||
* @default 0
|
||||
*/
|
||||
fuzzFactor?: number;
|
||||
|
||||
/**
|
||||
* Callback used to compare to given lines to determine if they should be considered equal when patching.
|
||||
* Should return `false` if the lines should be rejected.
|
||||
*
|
||||
* @default strict equality
|
||||
*/
|
||||
compareLine?: (
|
||||
lineNumber: number,
|
||||
line: string,
|
||||
operation: '-' | ' ',
|
||||
patchContent: string
|
||||
) => boolean;
|
||||
}
|
||||
|
||||
export interface ApplyPatchesOptions {
|
||||
loadFile(index: ParsedDiff, callback: (err: any, data: string) => void): void;
|
||||
patched(index: ParsedDiff, content: string, callback: (err: any) => void): void;
|
||||
complete(err: any): void;
|
||||
}
|
||||
|
||||
export interface Change {
|
||||
count?: number;
|
||||
/**
|
||||
* Text content.
|
||||
*/
|
||||
value: string;
|
||||
/**
|
||||
* `true` if the value was inserted into the new string.
|
||||
*/
|
||||
added?: boolean;
|
||||
/**
|
||||
* `true` if the value was removed from the old string.
|
||||
*/
|
||||
removed?: boolean;
|
||||
}
|
||||
|
||||
export interface ArrayChange<T> {
|
||||
value: T[];
|
||||
count?: number;
|
||||
added?: boolean;
|
||||
removed?: boolean;
|
||||
}
|
||||
|
||||
export interface ParsedDiff {
|
||||
index?: string;
|
||||
oldFileName?: string;
|
||||
newFileName?: string;
|
||||
oldHeader?: string;
|
||||
newHeader?: string;
|
||||
hunks: Hunk[];
|
||||
}
|
||||
|
||||
export interface Hunk {
|
||||
oldStart: number;
|
||||
oldLines: number;
|
||||
newStart: number;
|
||||
newLines: number;
|
||||
lines: string[];
|
||||
}
|
||||
|
||||
export interface BestPath {
|
||||
newPos: number;
|
||||
componenets: Change[];
|
||||
}
|
||||
|
||||
export class Diff {
|
||||
diff(
|
||||
oldString: string,
|
||||
newString: string,
|
||||
options?: Callback | (ArrayOptions<any, any> & Partial<CallbackOptions>)
|
||||
): Change[];
|
||||
|
||||
pushComponent(components: Change[], added: boolean, removed: boolean): void;
|
||||
|
||||
extractCommon(
|
||||
basePath: BestPath,
|
||||
newString: string,
|
||||
oldString: string,
|
||||
diagonalPath: number
|
||||
): number;
|
||||
|
||||
equals(left: any, right: any): boolean;
|
||||
|
||||
removeEmpty(array: any[]): any[];
|
||||
|
||||
castInput(value: any): any;
|
||||
|
||||
join(chars: string[]): string;
|
||||
|
||||
tokenize(value: string): any; // return types are string or string[]
|
||||
}
|
||||
|
||||
/**
|
||||
* Diffs two blocks of text, comparing character by character.
|
||||
*
|
||||
* @returns A list of change objects.
|
||||
*/
|
||||
export function diffChars(oldStr: string, newStr: string, options?: BaseOptions): Change[];
|
||||
export function diffChars(
|
||||
oldStr: string,
|
||||
newStr: string,
|
||||
options: Callback | (BaseOptions & CallbackOptions)
|
||||
): void;
|
||||
|
||||
/**
|
||||
* Diffs two blocks of text, comparing word by word, ignoring whitespace.
|
||||
*
|
||||
* @returns A list of change objects.
|
||||
*/
|
||||
export function diffWords(oldStr: string, newStr: string, options?: WordsOptions): Change[];
|
||||
export function diffWords(
|
||||
oldStr: string,
|
||||
newStr: string,
|
||||
options: Callback | (WordsOptions & CallbackOptions)
|
||||
): void;
|
||||
|
||||
/**
|
||||
* Diffs two blocks of text, comparing word by word, treating whitespace as significant.
|
||||
*
|
||||
* @returns A list of change objects.
|
||||
*/
|
||||
export function diffWordsWithSpace(
|
||||
oldStr: string,
|
||||
newStr: string,
|
||||
options?: WordsOptions
|
||||
): Change[];
|
||||
export function diffWordsWithSpace(
|
||||
oldStr: string,
|
||||
newStr: string,
|
||||
options: Callback | (WordsOptions & CallbackOptions)
|
||||
): void;
|
||||
|
||||
/**
|
||||
* Diffs two blocks of text, comparing line by line.
|
||||
*
|
||||
* @returns A list of change objects.
|
||||
*/
|
||||
export function diffLines(oldStr: string, newStr: string, options?: LinesOptions): Change[];
|
||||
export function diffLines(
|
||||
oldStr: string,
|
||||
newStr: string,
|
||||
options: Callback | (LinesOptions & CallbackOptions)
|
||||
): void;
|
||||
|
||||
/**
|
||||
* Diffs two blocks of text, comparing line by line, ignoring leading and trailing whitespace.
|
||||
*
|
||||
* @returns A list of change objects.
|
||||
*/
|
||||
export function diffTrimmedLines(oldStr: string, newStr: string, options?: LinesOptions): Change[];
|
||||
export function diffTrimmedLines(
|
||||
oldStr: string,
|
||||
newStr: string,
|
||||
options: Callback | (LinesOptions & CallbackOptions)
|
||||
): void;
|
||||
|
||||
/**
|
||||
* Diffs two blocks of text, comparing sentence by sentence.
|
||||
*
|
||||
* @returns A list of change objects.
|
||||
*/
|
||||
export function diffSentences(oldStr: string, newStr: string, options?: BaseOptions): Change[];
|
||||
export function diffSentences(
|
||||
oldStr: string,
|
||||
newStr: string,
|
||||
options: Callback | (BaseOptions & CallbackOptions)
|
||||
): void;
|
||||
|
||||
/**
|
||||
* Diffs two blocks of text, comparing CSS tokens.
|
||||
*
|
||||
* @returns A list of change objects.
|
||||
*/
|
||||
export function diffCss(oldStr: string, newStr: string, options?: BaseOptions): Change[];
|
||||
export function diffCss(
|
||||
oldStr: string,
|
||||
newStr: string,
|
||||
options: Callback | (BaseOptions & CallbackOptions)
|
||||
): void;
|
||||
|
||||
/**
|
||||
* Diffs two JSON objects, comparing the fields defined on each. The order of fields, etc does not matter
|
||||
* in this comparison.
|
||||
*
|
||||
* @returns A list of change objects.
|
||||
*/
|
||||
export function diffJson(
|
||||
oldObj: string | object,
|
||||
newObj: string | object,
|
||||
options?: JsonOptions
|
||||
): Change[];
|
||||
export function diffJson(
|
||||
oldObj: string | object,
|
||||
newObj: string | object,
|
||||
options: Callback | (JsonOptions & CallbackOptions)
|
||||
): void;
|
||||
|
||||
/**
|
||||
* Diffs two arrays, comparing each item for strict equality (`===`).
|
||||
*
|
||||
* @returns A list of change objects.
|
||||
*/
|
||||
export function diffArrays<TOld, TNew>(
|
||||
oldArr: TOld[],
|
||||
newArr: TNew[],
|
||||
options?: ArrayOptions<TOld, TNew>
|
||||
): Array<ArrayChange<TOld | TNew>>;
|
||||
|
||||
/**
|
||||
* Creates a unified diff patch.
|
||||
*
|
||||
* @param oldFileName String to be output in the filename section of the patch for the removals.
|
||||
* @param newFileName String to be output in the filename section of the patch for the additions.
|
||||
* @param oldStr Original string value.
|
||||
* @param newStr New string value.
|
||||
* @param oldHeader Additional information to include in the old file header.
|
||||
* @param newHeader Additional information to include in the new file header.
|
||||
*/
|
||||
export function createTwoFilesPatch(
|
||||
oldFileName: string,
|
||||
newFileName: string,
|
||||
oldStr: string,
|
||||
newStr: string,
|
||||
oldHeader?: string,
|
||||
newHeader?: string,
|
||||
options?: PatchOptions
|
||||
): string;
|
||||
|
||||
/**
|
||||
* Creates a unified diff patch.
|
||||
* Just like `createTwoFilesPatch()`, but with `oldFileName` being equal to `newFileName`.
|
||||
*
|
||||
* @param fileName String to be output in the filename section.
|
||||
* @param oldStr Original string value.
|
||||
* @param newStr New string value.
|
||||
* @param oldHeader Additional information to include in the old file header.
|
||||
* @param newHeader Additional information to include in the new file header.
|
||||
*/
|
||||
export function createPatch(
|
||||
fileName: string,
|
||||
oldStr: string,
|
||||
newStr: string,
|
||||
oldHeader?: string,
|
||||
newHeader?: string,
|
||||
options?: PatchOptions
|
||||
): string;
|
||||
|
||||
/**
|
||||
* This method is similar to `createTwoFilesPatch()`, but returns a data structure suitable for further processing.
|
||||
* Parameters are the same as `createTwoFilesPatch()`.
|
||||
*
|
||||
* @param oldFileName String to be output in the `oldFileName` hunk property.
|
||||
* @param newFileName String to be output in the `newFileName` hunk property.
|
||||
* @param oldStr Original string value.
|
||||
* @param newStr New string value.
|
||||
* @param oldHeader Additional information to include in the `oldHeader` hunk property.
|
||||
* @param newHeader Additional information to include in the `newHeader` hunk property.
|
||||
* @returns An object with an array of hunk objects.
|
||||
*/
|
||||
export function structuredPatch(
|
||||
oldFileName: string,
|
||||
newFileName: string,
|
||||
oldStr: string,
|
||||
newStr: string,
|
||||
oldHeader?: string,
|
||||
newHeader?: string,
|
||||
options?: PatchOptions
|
||||
): ParsedDiff;
|
||||
|
||||
/**
|
||||
* Applies a unified diff patch.
|
||||
*
|
||||
* @param patch May be a string diff or the output from the `parsePatch()` or `structuredPatch()` methods.
|
||||
* @returns A string containing new version of provided data.
|
||||
*/
|
||||
export function applyPatch(
|
||||
source: string,
|
||||
patch: string | ParsedDiff | [ParsedDiff],
|
||||
options?: ApplyPatchOptions
|
||||
): string;
|
||||
|
||||
/**
|
||||
* Applies one or more patches.
|
||||
* This method will iterate over the contents of the patch and apply to data provided through callbacks.
|
||||
*
|
||||
* The general flow for each patch index is:
|
||||
*
|
||||
* 1. `options.loadFile(index, callback)` is called. The caller should then load the contents of the file
|
||||
* and then pass that to the `callback(err, data)` callback. Passing an `err` will terminate further patch execution.
|
||||
* 2. `options.patched(index, content, callback)` is called once the patch has been applied. `content` will be
|
||||
* the return value from `applyPatch()`. When it's ready, the caller should call `callback(err)` callback.
|
||||
* Passing an `err` will terminate further patch execution.
|
||||
* 3. Once all patches have been applied or an error occurs, the `options.complete(err)` callback is made.
|
||||
*/
|
||||
export function applyPatches(patch: string | ParsedDiff[], options: ApplyPatchesOptions): void;
|
||||
|
||||
/**
|
||||
* Parses a patch into structured data.
|
||||
*
|
||||
* @returns A JSON object representation of the a patch, suitable for use with the `applyPatch()` method.
|
||||
*/
|
||||
export function parsePatch(diffStr: string, options?: { strict?: boolean }): ParsedDiff[];
|
||||
|
||||
/**
|
||||
* Converts a list of changes to a serialized XML format.
|
||||
*/
|
||||
export function convertChangesToXML(changes: Change[]): string;
|
||||
|
||||
/**
|
||||
* Converts a list of changes to [DMP](http://code.google.com/p/google-diff-match-patch/wiki/API) format.
|
||||
*/
|
||||
export function convertChangesToDMP(changes: Change[]): Array<[1 | 0 | -1, string]>;
|
||||
|
||||
export function merge(mine: string, theirs: string, base: string): ParsedDiff;
|
||||
|
||||
export function canonicalize(obj: any, stack: any[], replacementStack: any[]): any;
|
||||
|
||||
@@ -2,12 +2,11 @@
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
@@ -21,4 +20,4 @@
|
||||
"index.d.ts",
|
||||
"diff-tests.ts"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"interface-name": false,
|
||||
"export-just-namespace": false
|
||||
}
|
||||
}
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
|
||||
@@ -0,0 +1,122 @@
|
||||
import jsdiff = require('diff');
|
||||
const one = 'beep boop';
|
||||
const other = 'beep boob blah';
|
||||
|
||||
let diff = jsdiff.diffChars(one, other);
|
||||
printDiff(diff);
|
||||
|
||||
const diffArraysResult = jsdiff.diffArrays<string>(['a', 'b', 'c'], ['a', 'c', 'd']);
|
||||
diffArraysResult.forEach(result => {
|
||||
if (result.added) {
|
||||
console.log(`added ${result.value.length} line(s):`, ...result.value);
|
||||
} else if (result.removed) {
|
||||
console.log(`removed ${result.value.length} line(s):`, ...result.value);
|
||||
} else {
|
||||
console.log(`no changes`);
|
||||
}
|
||||
});
|
||||
|
||||
interface DiffObj {
|
||||
value: number;
|
||||
}
|
||||
const a: DiffObj = {value: 0};
|
||||
const b: DiffObj = {value: 1};
|
||||
const c: DiffObj = {value: 2};
|
||||
const d: DiffObj = {value: 3};
|
||||
const arrayOptions: jsdiff.IArrayOptions = {
|
||||
comparator: (left: DiffObj, right: DiffObj) => {
|
||||
return left.value === right.value;
|
||||
}
|
||||
};
|
||||
const diffResult = jsdiff.diffArrays([a, b, c], [a, b, d], arrayOptions);
|
||||
diffResult.forEach(result => {
|
||||
if (result.added) {
|
||||
console.log(`added ${result.value.length} line(s):`, ...result.value);
|
||||
} else if (result.removed) {
|
||||
console.log(`removed ${result.value.length} line(s):`, ...result.value);
|
||||
} else {
|
||||
console.log(`no changes`);
|
||||
}
|
||||
});
|
||||
|
||||
// --------------------------
|
||||
|
||||
class LineDiffWithoutWhitespace extends jsdiff.Diff {
|
||||
tokenize(value: string): any {
|
||||
return value.split(/^/m);
|
||||
}
|
||||
|
||||
equals(left: string, right: string): boolean {
|
||||
return left.trim() === right.trim();
|
||||
}
|
||||
}
|
||||
|
||||
const obj = new LineDiffWithoutWhitespace();
|
||||
diff = obj.diff(one, other);
|
||||
printDiff(diff);
|
||||
|
||||
function printDiff(diff: jsdiff.IDiffResult[]) {
|
||||
function addLineHeader(decorator: string, str: string | string[]) {
|
||||
return (typeof str === 'string' ? str.split("\n") : str).map((line, index, array) => {
|
||||
if (index === array.length - 1 && line === "") {
|
||||
return line;
|
||||
} else {
|
||||
return decorator + line;
|
||||
}
|
||||
}).join("\n");
|
||||
}
|
||||
|
||||
diff.forEach((part) => {
|
||||
if (part.added) {
|
||||
console.log(addLineHeader("+", part.value));
|
||||
} else if (part.removed) {
|
||||
console.log(addLineHeader("-", part.value));
|
||||
} else {
|
||||
console.log(addLineHeader(" ", part.value));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function verifyPatchMethods(oldStr: string, newStr: string, uniDiff: jsdiff.IUniDiff) {
|
||||
const verifyPatch = jsdiff.parsePatch(
|
||||
jsdiff.createTwoFilesPatch("oldFile.ts", "newFile.ts", oldStr, newStr,
|
||||
"old", "new", { context: 1 }));
|
||||
|
||||
if (JSON.stringify(verifyPatch[0], Object.keys(verifyPatch[0]).sort()) !== JSON.stringify(uniDiff, Object.keys(uniDiff).sort())) {
|
||||
console.error("Patch did not match uniDiff");
|
||||
}
|
||||
}
|
||||
function verifyApplyMethods(oldStr: string, newStr: string, uniDiff: jsdiff.IUniDiff) {
|
||||
const verifyApply = [
|
||||
jsdiff.applyPatch(oldStr, uniDiff),
|
||||
jsdiff.applyPatch(oldStr, [uniDiff])
|
||||
];
|
||||
jsdiff.applyPatches([uniDiff], {
|
||||
loadFile: (index: number, callback: (err: Error, data: string) => void) => {
|
||||
callback(undefined, one);
|
||||
},
|
||||
patched: (index: number, content: string) => {
|
||||
verifyApply.push(content);
|
||||
},
|
||||
complete: (err?: Error) => {
|
||||
if (err) {
|
||||
console.error(err);
|
||||
}
|
||||
|
||||
verifyApply.forEach(result => {
|
||||
if (result !== newStr) {
|
||||
console.error("Result did not match newStr");
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
const uniDiffPatch = jsdiff.structuredPatch("oldFile.ts", "newFile.ts", one, other,
|
||||
"old", "new", { context: 1 });
|
||||
verifyPatchMethods(one, other, uniDiffPatch);
|
||||
|
||||
const uniDiffStr = jsdiff.createPatch("file.ts", one, other, "old", "new",
|
||||
{ context: 1 });
|
||||
const uniDiffApply = jsdiff.parsePatch(uniDiffStr)[0];
|
||||
verifyApplyMethods(one, other, uniDiffApply);
|
||||
Vendored
+121
@@ -0,0 +1,121 @@
|
||||
// Type definitions for diff 3.5
|
||||
// Project: https://github.com/kpdecker/jsdiff
|
||||
// Definitions by: vvakame <https://github.com/vvakame>
|
||||
// szdc <https://github.com/szdc>
|
||||
// moc-yuto <https://github.com/moc-yuto>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
export = JsDiff;
|
||||
export as namespace JsDiff;
|
||||
|
||||
declare namespace JsDiff {
|
||||
interface IOptions {
|
||||
ignoreCase: boolean;
|
||||
}
|
||||
|
||||
interface ILinesOptions extends IOptions {
|
||||
ignoreWhitespace?: boolean;
|
||||
newlineIsToken?: boolean;
|
||||
}
|
||||
|
||||
interface IArrayOptions {
|
||||
comparator?: (left: any, right: any) => boolean;
|
||||
}
|
||||
|
||||
interface IDiffResult {
|
||||
value: string;
|
||||
count?: number;
|
||||
added?: boolean;
|
||||
removed?: boolean;
|
||||
}
|
||||
|
||||
interface IDiffArraysResult<T> {
|
||||
value: T[];
|
||||
count?: number;
|
||||
added?: boolean;
|
||||
removed?: boolean;
|
||||
}
|
||||
|
||||
interface IBestPath {
|
||||
newPos: number;
|
||||
componenets: IDiffResult[];
|
||||
}
|
||||
|
||||
interface IHunk {
|
||||
oldStart: number;
|
||||
oldLines: number;
|
||||
newStart: number;
|
||||
newLines: number;
|
||||
lines: string[];
|
||||
}
|
||||
|
||||
interface IUniDiff {
|
||||
oldFileName: string;
|
||||
newFileName: string;
|
||||
oldHeader: string;
|
||||
newHeader: string;
|
||||
index: string;
|
||||
hunks: IHunk[];
|
||||
}
|
||||
|
||||
class Diff {
|
||||
diff(oldString: string, newString: string, options?: IOptions): IDiffResult[];
|
||||
|
||||
pushComponent(components: IDiffResult[], added: boolean, removed: boolean): void;
|
||||
|
||||
extractCommon(basePath: IBestPath, newString: string, oldString: string, diagonalPath: number): number;
|
||||
|
||||
equals(left: string, right: string): boolean;
|
||||
|
||||
removeEmpty(array: any[]): any[];
|
||||
|
||||
castInput(value: any): any;
|
||||
|
||||
join(chars: string[]): string;
|
||||
|
||||
tokenize(value: string): any; // return types are string or string[]
|
||||
}
|
||||
|
||||
function diffChars(oldStr: string, newStr: string, options?: IOptions): IDiffResult[];
|
||||
|
||||
function diffWords(oldStr: string, newStr: string, options?: IOptions): IDiffResult[];
|
||||
|
||||
function diffWordsWithSpace(oldStr: string, newStr: string, options?: IOptions): IDiffResult[];
|
||||
|
||||
function diffJson(oldObj: object, newObj: object, options?: IOptions): IDiffResult[];
|
||||
|
||||
function diffLines(oldStr: string, newStr: string, options?: ILinesOptions): IDiffResult[];
|
||||
|
||||
function diffCss(oldStr: string, newStr: string, options?: IOptions): IDiffResult[];
|
||||
|
||||
function diffTrimmedLines(oldStr: string, newStr: string, options?: ILinesOptions): IDiffResult[];
|
||||
|
||||
function diffSentences(oldStr: string, newStr: string, options?: IOptions): IDiffResult[];
|
||||
|
||||
function diffArrays<T>(oldArr: T[], newArr: T[], options?: IArrayOptions): Array<IDiffArraysResult<T>>;
|
||||
|
||||
function createPatch(fileName: string, oldStr: string, newStr: string, oldHeader: string, newHeader: string, options?: {context: number}): string;
|
||||
|
||||
function createTwoFilesPatch(oldFileName: string, newFileName: string, oldStr: string, newStr: string, oldHeader: string, newHeader: string, options?: {context: number}): string;
|
||||
|
||||
function structuredPatch(oldFileName: string, newFileName: string, oldStr: string, newStr: string, oldHeader: string, newHeader: string, options?: {context: number}): IUniDiff;
|
||||
|
||||
function applyPatch(oldStr: string, uniDiff: string | IUniDiff | IUniDiff[]): string;
|
||||
|
||||
function applyPatches(uniDiff: IUniDiff[], options: {
|
||||
loadFile(index: number, callback: (err: Error, data: string) => void): void,
|
||||
patched(index: number, content: string): void,
|
||||
complete(err?: Error): void
|
||||
}): void;
|
||||
|
||||
function parsePatch(diffStr: string, options?: {strict: boolean}): IUniDiff[];
|
||||
|
||||
function convertChangesToXML(changes: IDiffResult[]): string;
|
||||
|
||||
function convertChangesToDMP(changes: IDiffResult[]): Array<{0: number; 1: string; }>;
|
||||
|
||||
function merge(mine: string, theirs: string, base: string): IUniDiff;
|
||||
|
||||
function canonicalize(obj: any, stack: any[], replacementStack: any[]): any;
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../../",
|
||||
"typeRoots": [
|
||||
"../../"
|
||||
],
|
||||
"paths": {
|
||||
"diff": [
|
||||
"diff/v3"
|
||||
]
|
||||
},
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"diff-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"interface-name": false,
|
||||
"export-just-namespace": false
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
import dlv from 'dlv';
|
||||
|
||||
const obj = {
|
||||
undef: undefined,
|
||||
zero: 0,
|
||||
one: 1,
|
||||
n: null,
|
||||
f: false,
|
||||
a: {
|
||||
two: 2,
|
||||
b: {
|
||||
three: 3,
|
||||
c: {
|
||||
four: 4
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Test without defaults
|
||||
dlv(obj, '');
|
||||
dlv(obj, 'one');
|
||||
dlv(obj, 'one.two');
|
||||
dlv(obj, 'a');
|
||||
dlv(obj, 'a.two');
|
||||
dlv(obj, 'a.b');
|
||||
dlv(obj, 'a.b.three');
|
||||
dlv(obj, 'a.b.c');
|
||||
dlv(obj, 'a.b.c.four');
|
||||
dlv(obj, 'n');
|
||||
dlv(obj, 'n.badkey');
|
||||
dlv(obj, 'f');
|
||||
dlv(obj, 'f.badkey');
|
||||
|
||||
// Test defaults
|
||||
dlv(obj, '', 'foo');
|
||||
dlv(obj, 'undef', 'foo');
|
||||
dlv(obj, 'n', null);
|
||||
dlv(obj, 'n.badkey', 'foo');
|
||||
dlv(obj, 'zero', 0);
|
||||
dlv(obj, 'a.badkey', 'foo');
|
||||
dlv(obj, 'a.badkey.anotherbadkey', 'foo');
|
||||
dlv(obj, 'f', false);
|
||||
dlv(obj, 'f.badkey', 'foo');
|
||||
Vendored
+12
@@ -0,0 +1,12 @@
|
||||
// Type definitions for dlv 1.1
|
||||
// Project: https://github.com/developit/dlv#readme
|
||||
// Definitions by: Ryan Sonshine <https://github.com/ryansonshine>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
/**
|
||||
* Safely get a dot-notated path within a nested object, with ability to
|
||||
* return a default if the full key path does not exist or the value is
|
||||
* undefined
|
||||
*/
|
||||
export default function dlv(object: object, key: string | string[], defaultValue?: any): any;
|
||||
@@ -2,13 +2,11 @@
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": false,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
@@ -16,10 +14,10 @@
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"target": "es2015"
|
||||
"strictFunctionTypes": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"webdriverio-tests.ts"
|
||||
"dlv-tests.ts"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Vendored
+4
@@ -174,6 +174,10 @@ declare namespace Dockerode {
|
||||
|
||||
update(options: {}, callback: Callback<any>): void;
|
||||
update(options: {}): Promise<any>;
|
||||
|
||||
logs(options: ContainerLogsOptions, callback: Callback<NodeJS.ReadableStream>): void;
|
||||
logs(callback: Callback<NodeJS.ReadableStream>): void;
|
||||
logs(options?: ContainerLogsOptions): Promise<NodeJS.ReadableStream>;
|
||||
}
|
||||
|
||||
class Task {
|
||||
|
||||
@@ -47,12 +47,21 @@ var newObj = {
|
||||
nested: {
|
||||
value: 'Hi there!'
|
||||
}
|
||||
},
|
||||
breath: {
|
||||
value: 'Hello'
|
||||
}
|
||||
};
|
||||
|
||||
var val = dot.pick('some.nested.value', newObj);
|
||||
console.log(val);
|
||||
|
||||
// Set a new value
|
||||
val = dot.str('breath.value', 'World', newObj);
|
||||
|
||||
// Replacing with a new object
|
||||
val = dot.set('breath', { value: 'Goodbye' }, newObj);
|
||||
|
||||
// Pick & Remove the value
|
||||
val = dot.pick('some.nested.value', newObj, true);
|
||||
|
||||
|
||||
Vendored
+16
-2
@@ -1,7 +1,8 @@
|
||||
// Type definitions for Dot-Object v1.5
|
||||
// Type definitions for Dot-Object 1.7
|
||||
// Project: https://github.com/rhalff/dot-object
|
||||
// Definitions by: Niko Kovačič <https://github.com/nkovacic>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
|
||||
declare namespace DotObject {
|
||||
@@ -120,12 +121,25 @@ declare namespace DotObject {
|
||||
*/
|
||||
remove(path: string, obj: any): any;
|
||||
/**
|
||||
*
|
||||
* Replace/create with a string
|
||||
*
|
||||
* @param {String} path dotted path
|
||||
* @param {String} v value to be set
|
||||
* @param {Object} obj object to be modified
|
||||
* @param {Function|Array} mods optional modifier
|
||||
*/
|
||||
str(path: string, v: any, obj: Object, mods?: ModifierFunctionWrapper | Array<ModifierFunctionWrapper>): void;
|
||||
str(path: string, v: any, obj: object, mods?: ModifierFunctionWrapper | Array<ModifierFunctionWrapper>): void;
|
||||
/**
|
||||
*
|
||||
* Replace/merge an object to an existing object property
|
||||
*
|
||||
* @param {String} path dotted path
|
||||
* @param {Object} v object to be set
|
||||
* @param {Object} obj object to be modified
|
||||
* @param {Boolean} merge optional merge
|
||||
*/
|
||||
set(path: string, v: any, obj: object, merge?: boolean): void;
|
||||
/**
|
||||
*
|
||||
* Transfer a property from one object to another object.
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
"ban-types": false,
|
||||
"callable-types": false,
|
||||
"comment-format": false,
|
||||
"dt-header": false,
|
||||
"eofline": false,
|
||||
"export-just-namespace": false,
|
||||
"import-spacing": false,
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
import dotenv = require("dotenv-flow");
|
||||
|
||||
const env = dotenv.config();
|
||||
const dbUrl: string | null = env.error || !env.parsed ? null : env.parsed["BASIC"];
|
||||
|
||||
dotenv.load({
|
||||
cwd: "someDir",
|
||||
encoding: "utf8",
|
||||
purge_dotenv: true
|
||||
});
|
||||
|
||||
const parsed = dotenv.parse("NODE_ENV=production\nDB_HOST=a.b.c");
|
||||
const dbHost: string = parsed["DB_HOST"];
|
||||
|
||||
const parsedFromBuffer = dotenv.parse(new Buffer("JUSTICE=league\n"), {
|
||||
debug: true
|
||||
});
|
||||
const justice: string = parsedFromBuffer["JUSTICE"];
|
||||
Vendored
+62
@@ -0,0 +1,62 @@
|
||||
// Type definitions for dotenv-flow 0.2
|
||||
// Project: https://github.com/motdotla/dotenv
|
||||
// Definitions by: Vincent Langlet <https://github.com/vincentlanglet>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
export interface DotenvParseOptions {
|
||||
/**
|
||||
* You may turn on logging to help debug why certain keys or values are not being set as you expect.
|
||||
*/
|
||||
debug?: boolean;
|
||||
}
|
||||
|
||||
export interface DotenvParseOutput {
|
||||
[name: string]: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parses a string or buffer in the .env file format into an object.
|
||||
*
|
||||
* @param src - contents to be parsed
|
||||
* @param options - additional options
|
||||
* @returns an object with keys and values based on `src`
|
||||
*/
|
||||
export function parse(
|
||||
src: string | Buffer,
|
||||
options?: DotenvParseOptions
|
||||
): DotenvParseOutput;
|
||||
|
||||
export interface DotenvConfigOptions {
|
||||
/**
|
||||
* You may specify a custom path if your file containing environment variables is located elsewhere.
|
||||
*/
|
||||
cwd?: string;
|
||||
|
||||
/**
|
||||
* You may specify the encoding of your file containing environment variables.
|
||||
*/
|
||||
encoding?: string;
|
||||
|
||||
/**
|
||||
* In some cases the original "dotenv" library can be used by one of the dependent npm modules. Use to fix this.
|
||||
*/
|
||||
purge_dotenv?: boolean;
|
||||
}
|
||||
|
||||
export interface DotenvConfigOutput {
|
||||
error?: Error;
|
||||
parsed?: DotenvParseOutput;
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads `.env` file contents into {@link https://nodejs.org/api/process.html#process_process_env | `process.env`}.
|
||||
* Example: 'KEY=value' becomes { parsed: { KEY: 'value' } }
|
||||
*
|
||||
* @param options - controls behavior
|
||||
* @returns an object with a `parsed` key if successful or `error` key if an error occurred
|
||||
*
|
||||
*/
|
||||
export function config(options?: DotenvConfigOptions): DotenvConfigOutput;
|
||||
export const load: typeof config;
|
||||
@@ -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",
|
||||
"dotenv-flow-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
@@ -0,0 +1,59 @@
|
||||
import * as drivelist from "drivelist";
|
||||
|
||||
drivelist.list((error, drives) => {
|
||||
if (!error) {
|
||||
drives.forEach(drive => {
|
||||
const {
|
||||
enumerator,
|
||||
busType,
|
||||
busVersion,
|
||||
device,
|
||||
devicePath,
|
||||
raw,
|
||||
description,
|
||||
error,
|
||||
size,
|
||||
blockSize,
|
||||
logicalBlockSize,
|
||||
mountpoints,
|
||||
isReadOnly,
|
||||
isSystem,
|
||||
isVirtual,
|
||||
isRemovable,
|
||||
isCard,
|
||||
isSCSI,
|
||||
isUSB,
|
||||
isUAS
|
||||
} = drive;
|
||||
|
||||
enumerator; // $ExpectType string
|
||||
busType; // $ExpectType BusType
|
||||
busVersion; // $ExpectType string | null
|
||||
device; // $ExpectType string
|
||||
devicePath; // $ExpectType string | null
|
||||
raw; // $ExpectType string
|
||||
description; // $ExpectType string
|
||||
error; // $ExpectType any
|
||||
size; // $ExpectType number | null
|
||||
blockSize; // $ExpectType number | null
|
||||
logicalBlockSize; // $ExpectType number | null
|
||||
|
||||
mountpoints; // $ExpectType MountPoint[]
|
||||
mountpoints.forEach(mountpoint => {
|
||||
const { path, label } = mountpoint;
|
||||
|
||||
path; // $ExpectType string
|
||||
label; // $ExpectType string | undefined
|
||||
});
|
||||
|
||||
isReadOnly; // $ExpectType boolean
|
||||
isSystem; // $ExpectType boolean
|
||||
isVirtual; // $ExpectType boolean | null
|
||||
isRemovable; // $ExpectType boolean | null
|
||||
isCard; // $ExpectType boolean | null
|
||||
isSCSI; // $ExpectType boolean | null
|
||||
isUSB; // $ExpectType boolean | null
|
||||
isUAS; // $ExpectType boolean | null
|
||||
});
|
||||
}
|
||||
});
|
||||
Vendored
+36
@@ -0,0 +1,36 @@
|
||||
// Type definitions for drivelist 6.4
|
||||
// Project: https://github.com/resin-io-modules/drivelist
|
||||
// Definitions by: Xiao Deng <https://github.com/WholeMilk>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export type BusType = "SATA" | "SCSI" | "ATA" | "IDE" | "PCI" | "UNKNOWN";
|
||||
|
||||
export interface MountPoint {
|
||||
path: string;
|
||||
label?: string;
|
||||
}
|
||||
|
||||
export interface Drive {
|
||||
enumerator: string;
|
||||
busType: BusType;
|
||||
busVersion: string | null;
|
||||
device: string;
|
||||
devicePath: string | null;
|
||||
raw: string;
|
||||
description: string;
|
||||
error: any; // can be null
|
||||
size: number | null;
|
||||
blockSize: number | null;
|
||||
logicalBlockSize: number | null;
|
||||
mountpoints: MountPoint[];
|
||||
isReadOnly: boolean;
|
||||
isSystem: boolean;
|
||||
isVirtual: boolean | null;
|
||||
isRemovable: boolean | null;
|
||||
isCard: boolean | null;
|
||||
isSCSI: boolean | null;
|
||||
isUSB: boolean | null;
|
||||
isUAS: boolean | null;
|
||||
}
|
||||
|
||||
export function list(callback: (error: any, drives: Drive[]) => void): 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",
|
||||
"drivelist-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Vendored
+113
@@ -0,0 +1,113 @@
|
||||
declare namespace Dynamsoft {
|
||||
let Lib: DynamsoftLib;
|
||||
let WebTwainEnv: dwtEnv;
|
||||
namespace WebTwain {
|
||||
namespace Addon {
|
||||
let OCRPro: OCRProAddon;
|
||||
}
|
||||
}
|
||||
namespace DWT {
|
||||
let defaultEnv: dwtEnv;
|
||||
}
|
||||
}
|
||||
|
||||
declare const dwt: WebTwain;
|
||||
|
||||
interface dwtEnv {
|
||||
ActiveXInstallWithCAB: boolean;
|
||||
ActiveXVersion: string;
|
||||
AutoLoad: boolean;
|
||||
CloseDialog(): void;
|
||||
ContainerMap: {};
|
||||
Containers: Container[];
|
||||
CreateDWTObject(newObjID: string, successFn: (dwtObject: WebTwain) => void, failurefn: (...args: any[]) => void): void;
|
||||
CreateDWTObject(newObjID: string, ip: number | string, port: number | string, portSSL: number | string, successFn: (dwtObject: WebTwain) => void, failurefn: (...args: any[]) => void): void;
|
||||
Debug: boolean;
|
||||
DeleteDWTObject(objID: string): void;
|
||||
DynamicContainers: string[];
|
||||
DynamicDWTMap: {};
|
||||
GetWebTwain(cid: string): WebTwain;
|
||||
IfUpdateService: boolean;
|
||||
IfUseActiveXForIE10Plus: boolean;
|
||||
JSVersion: string;
|
||||
Load(): void;
|
||||
|
||||
/*ignored
|
||||
OnWebTwainInitMessage OnWebTwainNeedUpgrade OnWebTwainNeedUpgradeWebJavascript OnWebTwainNotFound OnWebTwainOldPluginNotAllowed
|
||||
*/
|
||||
|
||||
OnWebTwainPostExecute(): void;
|
||||
OnWebTwainPreExecute(): void;
|
||||
|
||||
/*ignored
|
||||
OnWebTwainReady
|
||||
*/
|
||||
|
||||
PluginVersion: string;
|
||||
ProductKey: string;
|
||||
RegisterEvent(event: string, fn: (...args: any[]) => void): void;
|
||||
RemoveAllAuthorizations(): void;
|
||||
ResourcesPath: string;
|
||||
ServerVersionInfo: string;
|
||||
ShowDialog(_dialogWidth: number, _dialogHeight: number, _strDialogMessageWithHtmlFormat: string, _bChangeImage: boolean, bHideCloseButton: boolean): void;
|
||||
Trial: boolean;
|
||||
Unload(): void;
|
||||
UseDefaultInstallUI: boolean;
|
||||
initQueue: any[];
|
||||
inited: boolean;
|
||||
}
|
||||
|
||||
interface DynamsoftLib {
|
||||
/*ignored
|
||||
Addon_Events Addon_Sendback_Events AttachAndShowImage BIO DOM DynamicLoadAddonFuns DynamicWebTwain EnumMouseButton
|
||||
Errors Events IntToColorStr LS OnGetImageByURL OnGetImageFromServer Path ProgressBar UI Uri
|
||||
addEventListener ajax all appendMessage appendRichMessage aryControlLoadImage attachAddon attachProperty
|
||||
base64 bio cancelFrome clearMessage closeAll closeProgress colorStrToInt config css currentStyle
|
||||
debug*/
|
||||
|
||||
detect: {
|
||||
/*ignored
|
||||
OnCreatWS OnDetectNext OnWebTwainPostExecute OnWebTwainPreExecute StartWSByIPTimeoutId StartWSTimeoutId
|
||||
aryReconnectSTwains arySTwains arySTwainsByIP bFirst bNeedUpgradeEvent bNoControlEvent bOK bPromptJSOrServerOutdated
|
||||
cUrlIndex dcpCallbackType dcpStatus detectType getVersionArray global_dlg hideMask isDWTVersionLatest onNoControl
|
||||
onNotAllowedForChrome ports scriptLoaded showMask starting tryTimes*/
|
||||
ssl: boolean;
|
||||
};
|
||||
|
||||
/*ignored
|
||||
detectButton dialog dialogShowStatus dlgProgress dlgRef drawBoxBorder drawImageWithHermite
|
||||
each empty endsWith
|
||||
*/
|
||||
|
||||
env: {
|
||||
WSSession: number, WSVersion: string,
|
||||
bChrome: boolean, bEdge: boolean, bFileSystem: boolean, bFirefox: boolean,
|
||||
bIE: boolean, bLinux: boolean, bMac: boolean, bSafari: boolean, bWin: boolean, bWin64: boolean,
|
||||
basePath: string, iPluginLength: number, isX64: boolean, pathType: number,
|
||||
strChromeVersion: string, strFirefoxVersion: string, strIEVersion: string
|
||||
};
|
||||
|
||||
/*ignored
|
||||
error escapeHtml escapeRegExp extend filter fireEvent fromUnicode get getColor getCss
|
||||
getElDimensions getHex getHexColor getHttpUrl getLogger getOffset getRandom getRealPath getScript
|
||||
getWS getWSUrl getWheelDelta globalEval guid hide html5 imageControlCount indexOf install
|
||||
io isArray isBoolean isDef isFunction isLocalIP isNaN isNull isNumber isObject
|
||||
isPlainObject isString isUndef isUndefined isWindow keys log main makeArray mix
|
||||
needShowTwiceShowDialog nil noop now obj one page param parse parseHTML parser
|
||||
product progressMessage ready removeEventListener replaceAll replaceControl show showProgress startWS
|
||||
startWSByIP startsWith stopPropagation stringify style support switchEvent tmp toggle trim
|
||||
type unEscapeHtml unparam upperCaseFirst urlDecode urlEncode utf8 win
|
||||
...other internal ones
|
||||
*/
|
||||
hideMask(): void;
|
||||
showMask(): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* interface for a DWT container which basically defines a DIV on the page
|
||||
*/
|
||||
interface Container {
|
||||
ContainerId: string;
|
||||
Width: string | number;
|
||||
Height: string | number;
|
||||
}
|
||||
Vendored
+192
@@ -0,0 +1,192 @@
|
||||
declare enum EnumDWT_OCRLanguage {
|
||||
OCRL_ENG = "eng",
|
||||
OCRL_ARA = "ara",
|
||||
OCRL_CHI_SIM = "chi_sim",
|
||||
OCRL_CHI_TRA = "chi_tra",
|
||||
OCRL_HIN = "hin",
|
||||
OCRL_URD = "urd",
|
||||
OCRL_SPA = "spa",
|
||||
OCRL_FRA = "fra",
|
||||
OCRL_MSA = "msa",
|
||||
OCRL_IND = "ind",
|
||||
OCRL_RUS = "rus",
|
||||
OCRL_BEN = "ben",
|
||||
OCRL_POR = "por",
|
||||
OCRL_PAN = "pan",
|
||||
OCRL_DEU = "deu",
|
||||
OCRL_JPN = "jpn",
|
||||
OCRL_FAS = "fas",
|
||||
OCRL_SWA = "swa",
|
||||
OCRL_JAV = "jav",
|
||||
OCRL_TEL = "tel",
|
||||
OCRL_TUR = "tur",
|
||||
OCRL_KOR = "kor",
|
||||
OCRL_MAR = "mar",
|
||||
OCRL_TAM = "tam",
|
||||
OCRL_VIE = "vie",
|
||||
OCRL_ITA = "ita",
|
||||
OCRL_THA = "tha"
|
||||
}
|
||||
|
||||
declare enum EnumDWT_OCRPageSetMode {
|
||||
OCRPSM_OSD_ONLY = 0,
|
||||
PSM_AUTO_OSD = 1,
|
||||
PSM_AUTO_ONLY = 2,
|
||||
PSM_AUTO = 3,
|
||||
PSM_SINGLE_COLUMN = 4,
|
||||
PSM_SINGLE_BLOCK_VERT_TEXT = 5,
|
||||
PSM_SINGLE_BLOCK = 6,
|
||||
PSM_SINGLE_LINE = 7,
|
||||
PSM_SINGLE_WORD = 8,
|
||||
PSM_CIRCLE_WORD = 9,
|
||||
PSM_SINGLE_CHAR = 10
|
||||
}
|
||||
|
||||
declare enum EnumDWT_OCROutputFormat {
|
||||
OCROF_TEXT = 0,
|
||||
OCROF_PDFPLAINTEXT = 1,
|
||||
OCROF_PDFIMAGEOVERTEXT = 2,
|
||||
OCROF_PDFPLAINTEXT_PDFX = 3,
|
||||
OCROF_PDFIMAGEOVERTEXT_PDFX = 4
|
||||
}
|
||||
|
||||
/**
|
||||
* @class
|
||||
*/
|
||||
interface OCR {
|
||||
/**
|
||||
* Downloads and installs the ocr add-on on the local system.
|
||||
* @method Dynamsoft.WebTwain#Download
|
||||
* @param {string} remoteFile specifies the value of which frame to get.
|
||||
* @param {function} optionalAsyncSuccessFunc optional. The function to call when the download succeeds. Please refer to the function prototype OnSuccess.
|
||||
* @param {function} optionalAsyncFailureFunc optional. The function to call when the download fails. Please refer to the function prototype OnFailure.
|
||||
* @return {boolean}
|
||||
*/
|
||||
Download(remoteFile: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: () => void): void;
|
||||
|
||||
/**
|
||||
* Downloads and deploys the OCR language package on the local system.
|
||||
* @method Dynamsoft.WebTwain#DownloadLangData
|
||||
* @param {string} remoteFile specifies the value of which frame to get.
|
||||
* @param {function} optionalAsyncSuccessFunc optional. The function to call when the download succeeds. Please refer to the function prototype OnSuccess.
|
||||
* @param {function} optionalAsyncFailureFunc optional. The function to call when the download fails. Please refer to the function prototype OnFailure.
|
||||
* @return {boolean}
|
||||
*/
|
||||
DownloadLangData(remoteFile: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: () => void): void;
|
||||
|
||||
/**
|
||||
* Performs OCR on a given image.
|
||||
* @method Dynamsoft.WebTwain#Read
|
||||
* @param {number} sImageIndex Specifies the index of the image.
|
||||
* @param {function} AsyncSuccessFunc The function to call when OCR operation succeeds. Please refer to the function prototype OnOCRSuccess.
|
||||
* @param {function} AsyncFailureFunc The function to call when OCR operation fails. Please refer to the function prototype OnOCRFailure.
|
||||
* @return {boolean}
|
||||
*/
|
||||
Recognize(sImageIndex: number, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: () => void): void;
|
||||
|
||||
/**
|
||||
* Peforms OCR on the given rectangle on a specified image.
|
||||
* @method Dynamsoft.WebTwain#ReadRect
|
||||
* @param {number} sImageIndex Specifies the index of the image.
|
||||
* @param {number} left specifies the x-coordinate of the upper-left corner of the rectangle.
|
||||
* @param {number} top specifies the y-coordinate of the upper-left corner of the rectangle.
|
||||
* @param {number} right specifies the x-coordinate of the lower-right corner of the rectangle.
|
||||
* @param {number} bottom specifies the y-coordinate of the lower-right corner of the rectangle.
|
||||
* @param {function} AsyncSuccessFunc The function to call when OCR operation succeeds. Please refer to the function prototype OnOCRSuccess.
|
||||
* @param {function} AsyncFailureFunc The function to call when OCR operation fails. Please refer to the function prototype OnOCRFailure.
|
||||
* @return {boolean}
|
||||
*/
|
||||
RecognizeRect(sImageIndex: number, left: number, top: number, right: number, bottom: number, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: () => void): void;
|
||||
|
||||
/**
|
||||
* Performs OCR on one or multiple specified local file(s) directly.
|
||||
* @method Dynamsoft.WebTwain#Read
|
||||
* @param {string} fileNames Specifies the local paths of the target files. If multiple files are given, they should be separated by the '|' character.
|
||||
* @param {function} AsyncSuccessFunc The function to call when OCR operation succeeds. Please refer to the function prototype OnOCRSuccess.
|
||||
* @param {function} AsyncFailureFunc The function to call when OCR operation fails. Please refer to the function prototype OnOCRFailure.
|
||||
* @return {boolean}
|
||||
*/
|
||||
RecognizeFile(fileNames: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: () => void): void;
|
||||
|
||||
/**
|
||||
* Performs OCR on the currently selected images in the buffer.
|
||||
* @method Dynamsoft.WebTwain#Read
|
||||
* @param {function} AsyncSuccessFunc The function to call when OCR operation succeeds. Please refer to the function prototype OnOCRSuccess.
|
||||
* @param {function} AsyncFailureFunc The function to call when OCR operation fails. Please refer to the function prototype OnOCRFailure.
|
||||
* @return {boolean}
|
||||
*/
|
||||
RecognizeSelectedImages(optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: () => void): void;
|
||||
|
||||
/**
|
||||
* Specifies a font to be used by OCR when Addon.OCR.SetIfUseDetectedFont is set to false.
|
||||
* @method Dynamsoft.WebTwain#SetUnicodeFontName
|
||||
* @param {string} name Specifies a font to be used by
|
||||
* @return {boolean}
|
||||
*/
|
||||
SetUnicodeFontName(name: string): void;
|
||||
|
||||
/**
|
||||
* Returns the detected OCR font name.
|
||||
* @method Dynamsoft.WebTwain#GetUnicodeFontName
|
||||
* @return {string} Returns the detected OCR font name.
|
||||
*/
|
||||
GetUnicodeFontName(): void;
|
||||
|
||||
/**
|
||||
* Determines whether PDF output should use the fonts detected by the OCR system, or the default/provided fonts instead.
|
||||
* @method Dynamsoft.WebTwain#SetIfUseDetectedFont
|
||||
* @param {boolean} bValue By default this is true, indicating detected fonts should be used. The detected fonts must exist on the user's system for this to be successful.
|
||||
* @return {boolean}
|
||||
*/
|
||||
SetIfUseDetectedFont(bValue: boolean): void;
|
||||
|
||||
/**
|
||||
* Returns whether PDF output should use the fonts detected by the OCR system, or the default/provided fonts instead.
|
||||
* @method Dynamsoft.WebTwain#GetIfUseDetectedFont
|
||||
* @return {boolean} Returns whether PDF output should use the fonts detected by the OCR system, or the default/provided fonts instead.
|
||||
*/
|
||||
GetIfUseDetectedFont(): void;
|
||||
|
||||
/**
|
||||
* Applies higher-level accuracy of OCR to the area of the image where the font size is bigger than the value set here.
|
||||
* @method Dynamsoft.WebTwain#SetIfUseDetectedFont
|
||||
* @param {number} nValue Specifies the font size base to apply the higher-level accracy OCR. The default value is 0 which means no regional accurate OCR is performed.
|
||||
* @return {boolean}
|
||||
*/
|
||||
SetMinFontSizeforMoreAccurateResult(nValue: number): void;
|
||||
|
||||
/**
|
||||
* Returns the font size base to apply higher-level regional accarate OCR which is set through Addon.OCR.SetMinFontSizeforMoreAccurateResult.
|
||||
* @method Dynamsoft.WebTwain#GetMinFontSizeforMoreAccurateResult
|
||||
* @return {boolean} Returns the font size base to apply higher-level regional accarate OCR. If the return value is 0, it indicates no regional accurate OCR is performed.
|
||||
*/
|
||||
GetMinFontSizeforMoreAccurateResult(): void;
|
||||
|
||||
/**
|
||||
* Sets the target language for OCR operations.
|
||||
* @method Dynamsoft.WebTwain#SetLanguage
|
||||
* @param {string} value Specifies the target language for OCR operation.
|
||||
* @return {boolean}
|
||||
*/
|
||||
SetLanguage(value: string): void;
|
||||
|
||||
/**
|
||||
* Sets the mode for OCR page layout analysis. Determines how pages are determined when processing OCR.
|
||||
* @method Dynamsoft.WebTwain#SetPageSetMode
|
||||
* @param {EnumDWT_OCRPageSetMode} value Specifies the OCR Page layout analysis mode.
|
||||
* @return {boolean}
|
||||
*/
|
||||
SetPageSetMode(value: EnumDWT_OCRPageSetMode): void;
|
||||
|
||||
/**
|
||||
* Sets the OCR result format. Determines whether the OCR output is in text or PDF format.
|
||||
* @method Dynamsoft.WebTwain#SetOutputFormat
|
||||
* @param {EnumDWT_OCROutputFormat} value Specifies the OCR result format.
|
||||
* @return {boolean}
|
||||
*/
|
||||
SetOutputFormat(value: EnumDWT_OCROutputFormat): void;
|
||||
}
|
||||
|
||||
interface WebTwainAddon {
|
||||
OCR: OCR;
|
||||
}
|
||||
Vendored
+164
@@ -0,0 +1,164 @@
|
||||
interface Redaction {
|
||||
FindText: string;
|
||||
FindTextFlags: EnumDWT_OCRFindTextFlags.OCRFT_WHOLEWORD;
|
||||
FindTextAction: EnumDWT_OCRFindTextAction.OCRFT_MARKFORREDACT;
|
||||
}
|
||||
|
||||
interface OCRZone {
|
||||
left: number;
|
||||
top: number;
|
||||
right: number;
|
||||
bottom: number;
|
||||
}
|
||||
|
||||
interface OCRReadPara {
|
||||
STWAIN: WebTwain;
|
||||
AjaxFunctionUrl: string;
|
||||
FunctionName: string;
|
||||
ImageIndex: number;
|
||||
FileNames: string;
|
||||
Type: string;
|
||||
AryZone: number[];
|
||||
JsonString: string;
|
||||
OnSuccess(): void;
|
||||
OnFailure(): void;
|
||||
}
|
||||
|
||||
interface OCRError {
|
||||
responseText: string;
|
||||
errorString: string;
|
||||
}
|
||||
|
||||
interface Settings {
|
||||
RecognitionModule: string;
|
||||
Languages: string;
|
||||
OutputFormat: EnumDWT_OCRProOutputFormat;
|
||||
PDFVersion: EnumDWT_OCRProPDFVersion;
|
||||
PDFAVersion: EnumDWT_OCRProPDFAVersion;
|
||||
LicenseChecker: string;
|
||||
Redaction: Redaction;
|
||||
}
|
||||
|
||||
interface DynamsoftLib {
|
||||
NewRedaction(): Redaction;
|
||||
NewOCRReadPara(): OCRReadPara;
|
||||
NewOCRZone(): OCRZone;
|
||||
}
|
||||
|
||||
interface OCRProAddon {
|
||||
NewOCRError(): OCRError;
|
||||
NewOCRReadPara(): OCRReadPara;
|
||||
NewOCRZone(): OCRZone;
|
||||
NewSettings(): Settings;
|
||||
}
|
||||
|
||||
declare enum EnumDWT_OCRFindTextFlags {
|
||||
OCRFT_WHOLEWORD = 1,
|
||||
OCRFT_MATCHCASE = 2,
|
||||
OCRFT_FUZZYMATCH = 4
|
||||
}
|
||||
declare enum EnumDWT_OCRFindTextAction {
|
||||
OCRFT_HIGHLIGHT = 0,
|
||||
OCRFT_STRIKEOUT = 1,
|
||||
OCRFT_MARKFORREDACT = 2
|
||||
}
|
||||
|
||||
declare enum EnumDWT_OCRProOutputFormat {
|
||||
OCRPFT_IOTPDF = "IOTPDF",
|
||||
OCRPFT_IOTPDF_MRC = "IOTPDF_MRC",
|
||||
OCRPFT_TXTCSV = "TXTCSV",
|
||||
OCRPFT_TXTF = "TXTF",
|
||||
OCRPFT_TXTS = "TXTS",
|
||||
OCRPFT_XML = "XML"
|
||||
}
|
||||
|
||||
declare enum EnumDWT_OCRProPDFAVersion {
|
||||
OCRPPDFAV_1A = "pdf/a-1a",
|
||||
OCRPPDFAV_1B = "pdf/a-1b",
|
||||
OCRPPDFAV_2A = "pdf/a-2a",
|
||||
OCRPPDFAV_2B = "pdf/a-2b",
|
||||
OCRPPDFAV_2U = "pdf/a-2u",
|
||||
OCRPPDFAV_3A = "pdf/a-3a",
|
||||
OCRPPDFAV_3B = "pdf/a-3b",
|
||||
OCRPPDFAV_3U = "pdf/a-3u"
|
||||
}
|
||||
|
||||
declare enum EnumDWT_OCRProPDFVersion {
|
||||
OCRPPDFV_0 = "1.0",
|
||||
OCRPPDFV_1 = "1.1",
|
||||
OCRPPDFV_2 = "1.2",
|
||||
OCRPPDFV_3 = "1.3",
|
||||
OCRPPDFV_4 = "1.4",
|
||||
OCRPPDFV_5 = "1.5",
|
||||
OCRPPDFV_6 = "1.6",
|
||||
OCRPPDFV_7 = "1.7"
|
||||
}
|
||||
|
||||
declare enum EnumDWT_OCRProRecognitionModule {
|
||||
OCRPM_AUTO = "AUTO",
|
||||
OCRPM_MOSTACCURATE = "MOSTACCURATE",
|
||||
OCRPM_BALANCED = "BALANCED",
|
||||
OCRPM_FASTEST = "FASTEST"
|
||||
}
|
||||
|
||||
declare enum EnumDWT_OCRProType {
|
||||
OCRDT_File = 0,
|
||||
OCRDT_Index = 1
|
||||
}
|
||||
|
||||
interface OCRPro {
|
||||
/**
|
||||
* Returns whether OCR Pro addon is installed
|
||||
* @return {boolean}
|
||||
*/
|
||||
IsModuleInstalled(): boolean;
|
||||
|
||||
/**
|
||||
* Downloads and installs the ocr add-on on the local system.
|
||||
* @param {string} remoteFile specifies the URL to download a ZIP which contains the OCR Pro addon
|
||||
* @param {function} optionalAsyncSuccessFunc optional. The function to call when the download succeeds. Please refer to the function prototype OnSuccess.
|
||||
* @param {function} optionalAsyncFailureFunc optional. The function to call when the download fails. Please refer to the function prototype OnFailure.
|
||||
* @return {void}
|
||||
*/
|
||||
Download(remoteFile: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: () => void): void;
|
||||
|
||||
/**
|
||||
* Performs OCR on a given image.
|
||||
* @param {number} sImageIndex Specifies the index of the image.
|
||||
* @param {function} AsyncSuccessFunc The function to call when OCR operation succeeds. Please refer to the function prototype OnOCRSuccess.
|
||||
* @param {function} AsyncFailureFunc The function to call when OCR operation fails. Please refer to the function prototype OnOCRFailure.
|
||||
* @return {void}
|
||||
*/
|
||||
Recognize(sImageIndex: number, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: () => void): void;
|
||||
|
||||
/**
|
||||
* Performs OCR on one or multiple specified local file(s) directly.
|
||||
* @param {string} fileNames Specifies the local paths of the target files. If multiple files are given, they should be separated by the '|' character.
|
||||
* @param {function} AsyncSuccessFunc The function to call when OCR operation succeeds. Please refer to the function prototype OnOCRSuccess.
|
||||
* @param {function} AsyncFailureFunc The function to call when OCR operation fails. Please refer to the function prototype OnOCRFailure.
|
||||
* @return {void}
|
||||
*/
|
||||
RecognizeFile(fileNames: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: () => void): void;
|
||||
|
||||
/**
|
||||
* Peforms OCR on the given rectangle on a specified image.
|
||||
* @param {number} sImageIndex Specifies the index of the image.
|
||||
* @param {number[]} aryZone specifies the coordinates of the rectangle.
|
||||
* @param {function} AsyncSuccessFunc The function to call when OCR operation succeeds. Please refer to the function prototype OnOCRSuccess.
|
||||
* @param {function} AsyncFailureFunc The function to call when OCR operation fails. Please refer to the function prototype OnOCRFailure.
|
||||
* @return {void}
|
||||
*/
|
||||
RecognizeRect(sImageIndex: number, aryZone: number[], optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: () => void): void;
|
||||
|
||||
/**
|
||||
* Performs OCR on the currently selected images in the buffer.
|
||||
* @param {function} AsyncSuccessFunc The function to call when OCR operation succeeds. Please refer to the function prototype OnOCRSuccess.
|
||||
* @param {function} AsyncFailureFunc The function to call when OCR operation fails. Please refer to the function prototype OnOCRFailure.
|
||||
* @return {void}
|
||||
*/
|
||||
RecognizeSelectedImages(optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: () => void): void;
|
||||
}
|
||||
|
||||
interface WebTwainAddon {
|
||||
OCRPro: OCRPro;
|
||||
}
|
||||
Vendored
-15
@@ -1,14 +1,3 @@
|
||||
/*!
|
||||
* Dynamsoft WebTwain PDF Addon
|
||||
* Based on Dynamsoft WebTwain JavaScript Intellisense
|
||||
* Product: Dynamsoft Web Twain
|
||||
* Web Site: http://www.dynamsoft.com
|
||||
*
|
||||
* Copyright 2018, Dynamsoft Corporation
|
||||
* Author: Dynamsoft Support Team
|
||||
* Version: 14.2
|
||||
*/
|
||||
|
||||
declare enum EnumDWT_ConvertMode {
|
||||
CM_DEFAULT = 0,
|
||||
CM_RENDERALL = 1
|
||||
@@ -73,7 +62,3 @@ interface PDF {
|
||||
interface WebTwainAddon {
|
||||
PDF: PDF;
|
||||
}
|
||||
|
||||
interface WebTwain {
|
||||
Addon: WebTwainAddon;
|
||||
}
|
||||
|
||||
Vendored
+334
@@ -0,0 +1,334 @@
|
||||
/** -2400 to -2499 is webcam error code */
|
||||
declare enum EnumDWT_ErrorCode {
|
||||
/** All error from directshow sdk */
|
||||
WCERR_SYSTEM = -2400,
|
||||
/** Create ICreateDevEnum interface failed. */
|
||||
WCERR_FAIL_ICREATEDEVENUM = -2401,
|
||||
/** Create IEnumMoniker interface failed. */
|
||||
WCERR_FAIL_IENUMMONIKER = -2402,
|
||||
/** The camera doesn't support IAMVideoProcAmp interface. */
|
||||
WCERR_NOT_IAMVIDEOPROPERTY = -2403,
|
||||
/** The camera doesn't support IAMCameraControl interface. */
|
||||
WCERR_NOT_IAMCAMERACONTROL = -2404,
|
||||
/** The property doesn't support auto capability. */
|
||||
WCERR_NOT_AUTOPROPERTY = -2405,
|
||||
/** No webcam device is found. */
|
||||
WCERR_NO_DEVICE = -2406,
|
||||
/** Could not get video window interface */
|
||||
WCERR_FAIL_VIDEOWINDOW = -2407,
|
||||
/** Could not create filter graph. */
|
||||
WCERR_FAIL_FILTERGRAPH = -2408,
|
||||
/** Could not create SampleGrabber (isqedit.all registered?). */
|
||||
WCERR_FAIL_SAMPLEGRABBER = -2409,
|
||||
/** Unable to make NULL renderer */
|
||||
WCERR_NULLRENDER = -2410,
|
||||
/** Can't add the filter to graph */
|
||||
WCERR_FAIL_ADDFILTER = -2411,
|
||||
/** Can't build the graph */
|
||||
WCERR_FAIL_BUILDGRAPH = -2412,
|
||||
/** Failed to register filter graph with ROT. */
|
||||
WCERR_FAIL_REGFILTERGRAPH = -2413,
|
||||
/** Time out */
|
||||
WCERR_GRAB_TIMEOUT = -2414
|
||||
}
|
||||
|
||||
/** Specifies the video rotate mode on a video capture device. */
|
||||
declare enum EnumDWT_VideoRotateMode {
|
||||
/** Don't rotate */
|
||||
VRM_NONE = 0,
|
||||
/** 90 deg Clockwise */
|
||||
VRM_90_DEGREES_CLOCKWISE = 1,
|
||||
/** 180 deg Clockwise */
|
||||
VRM_180_DEGREES_CLOCKWISE = 2,
|
||||
/** 270 deg Clockwise */
|
||||
VRM_270_DEGREES_CLOCKWISE = 3,
|
||||
/** Flip */
|
||||
VRM_FLIP_VERTICAL = 4,
|
||||
/** Mirror */
|
||||
VRM_FLIP_HORIZONTAL = 5
|
||||
}
|
||||
|
||||
/** Specifies video properties on a video capture device. */
|
||||
declare enum EnumDWT_VideoProperty {
|
||||
/** Specifies the brightness, also called the black level. For NTSC, the value is expressed in IRE units * 100.
|
||||
* For non-NTSC sources, the units are arbitrary, with zero representing blanking and 10,000 representing pure white.
|
||||
* Values range from -10,000 to 10,000.
|
||||
*/
|
||||
VP_BRIGHTNESS = 0,
|
||||
/** Specifies the contrast, expressed as gain factor * 100. Values range from zero to 10,000. */
|
||||
VP_CONTRAST = 1,
|
||||
/** Specifies the hue, in degrees * 100. Values range from -180,000 to 180,000 (-180 to +180 degrees). */
|
||||
VP_HUE = 2,
|
||||
/** Specifies the saturation. Values range from 0 to 10,000. */
|
||||
VP_SATURATION = 3,
|
||||
/** Specifies the sharpness. Values range from 0 to 100. */
|
||||
VP_SHARPNESS = 4,
|
||||
/** Specifies the gamma, as gamma * 100. Values range from 1 to 500. */
|
||||
VP_GAMMA = 5,
|
||||
/** Specifies the color enable setting. The possible values are 0 (off) and 1 (on). */
|
||||
VP_COLORENABLE = 6,
|
||||
/** Specifies the white balance, as a color temperature in degrees Kelvin. The range of values depends on the device. */
|
||||
VP_WHITEBALANCE = 7,
|
||||
/** Specifies the backlight compensation setting. Possible values are 0 (off) and 1 (on). */
|
||||
VP_BACKLIGHTCOMPENSATION = 8,
|
||||
/** Specifies the gain adjustment. Zero is normal. Positive values are brighter and negative values are darker.
|
||||
* The range of values depends on the device.
|
||||
*/
|
||||
VP_GAIN = 9
|
||||
}
|
||||
|
||||
/** Specifies a setting on a camera. */
|
||||
declare enum EnumDWT_CameraControlProperty {
|
||||
/** Specifies the camera's pan setting, in degrees. Values range from -180 to +180, with the default set to zero.
|
||||
* Positive values are clockwise from the origin (the camera rotates clockwise when viewed from above),
|
||||
* and negative values are counterclockwise from the origin.
|
||||
*/
|
||||
CCP_PAN = 0,
|
||||
/** Specifies the camera's tilt setting, in degrees. Values range from -180 to +180, with the default set to zero.
|
||||
* Positive values point the imaging plane up, and negative values point the imaging plane down.
|
||||
*/
|
||||
CCP_TILT = 1,
|
||||
/** Specifies the camera's roll setting, in degrees. Values range from -180 to +180, with the default set to zero.
|
||||
* Positive values cause a clockwise rotation of the camera along the image-viewing axis, and negative values cause a counterclockwise rotation of the camera.
|
||||
*/
|
||||
CCP_ROLL = 2,
|
||||
/** Specifies the camera's zoom setting, in millimeters. Values range from 10 to 600, and the default is specific to the device. */
|
||||
CCP_ZOOM = 3,
|
||||
/** Specifies the exposure setting, in log base 2 seconds. In other words, for values less than zero, the exposure time is 1/2^n seconds,
|
||||
* and for values zero or above, the exposure time is 2^n seconds. For example:
|
||||
* Value Seconds
|
||||
* -3 1/8
|
||||
* -2 1/4
|
||||
* -1 1/2
|
||||
* 0 1
|
||||
* 1 2
|
||||
* 2 4
|
||||
*/
|
||||
CCP_EXPOSURE = 4,
|
||||
/** Specifies the camera's iris setting, in units of fstop* 10. */
|
||||
CCP_IRIS = 5,
|
||||
/** Specifies the camera's focus setting, as the distance to the optimally focused target, in millimeters.
|
||||
* The range and default value are specific to the device.
|
||||
*/
|
||||
CCP_FOCUS = 6
|
||||
}
|
||||
|
||||
interface WebcamMediaType {
|
||||
GetCount(): number;
|
||||
Get(index: number): string;
|
||||
GetCurrent(): string;
|
||||
}
|
||||
|
||||
interface WebcamResolution {
|
||||
GetCount(): number;
|
||||
Get(index: number): string;
|
||||
GetCurrent(): string;
|
||||
}
|
||||
|
||||
interface WebcamFrameRate {
|
||||
GetCount(): number;
|
||||
Get(index: number): string;
|
||||
GetCurrent(): string;
|
||||
}
|
||||
|
||||
interface CameraControlMoreSetting {
|
||||
GetMinValue(): number;
|
||||
GetMaxValue(): number;
|
||||
GetSteppingDelta(): number;
|
||||
GetDefaultValue(): number;
|
||||
GetIfAuto(): boolean;
|
||||
}
|
||||
|
||||
interface CameraControlSetting {
|
||||
GetValue(): number;
|
||||
GetIfAuto(): boolean;
|
||||
}
|
||||
|
||||
interface VideoPropertyMoreSetting {
|
||||
GetMinValue(): number;
|
||||
GetMaxValue(): number;
|
||||
GetSteppingDelta(): number;
|
||||
GetDefaultValue(): number;
|
||||
GetIfAuto(): boolean;
|
||||
}
|
||||
|
||||
interface VideoPropertySetting {
|
||||
GetValue(): number;
|
||||
GetIfAuto(): boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* @class
|
||||
*/
|
||||
interface Webcam {
|
||||
IsModuleInstalled(): boolean;
|
||||
GetFramePartURL(): string;
|
||||
GetFrameURL(): string;
|
||||
|
||||
/**
|
||||
* Download and install webcam add-on on the local system.
|
||||
* @method Dynamsoft.WebTwain#Download
|
||||
* @param {string} remoteFile:string specifies the value of which frame to get.
|
||||
* @param {function} optionalAsyncSuccessFunc optional. The function to call when the download succeeds. Please refer to the function prototype OnSuccess.
|
||||
* @param {function} optionalAsyncFailureFunc optional. The function to call when the download fails. Please refer to the function prototype OnFailure.
|
||||
* @return {boolean}
|
||||
*/
|
||||
Download(remoteFile: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: () => void): void;
|
||||
|
||||
/**
|
||||
* Return supported webcam source names.
|
||||
* @method Dynamsoft.WebTwain#GetSourceList
|
||||
* @return {string array}
|
||||
*/
|
||||
GetSourceList(): string[];
|
||||
|
||||
/**
|
||||
* Select the source with the specified name.
|
||||
* @method Dynamsoft.WebTwain#SelectSource
|
||||
* @param {string} strSourceName The source name.
|
||||
* @return {boolean}
|
||||
*/
|
||||
SelectSource(strSourceName: string): boolean;
|
||||
|
||||
/**
|
||||
* Close the selected source and release the webcam.
|
||||
* @method Dynamsoft.WebTwain#CloseSource
|
||||
* @return {boolean}
|
||||
*/
|
||||
CloseSource(): boolean;
|
||||
|
||||
/**
|
||||
* Show video stream in a specified container
|
||||
* @method Dynamsoft.WebTwain#StopVideo
|
||||
* @param {WebTwain} DWObject Specifies the WebTwain Object.
|
||||
* @param {number} quality Specifies the quality of each frame in the video stream. Only valid for the HTML5 edition.
|
||||
* @param {function} onFrameCaptured callback of the operation to capture
|
||||
* @return {void}
|
||||
*/
|
||||
PlayVideo(DWObject: WebTwain, quality: number, onFrameCaptured: () => void): void;
|
||||
|
||||
/**
|
||||
* Stop the video stream in the specified container
|
||||
* @method Dynamsoft.WebTwain#StopVideo
|
||||
* @return {boolean}
|
||||
*/
|
||||
StopVideo(): boolean;
|
||||
|
||||
/**
|
||||
* Capture image from the specified webcam.
|
||||
* @method Dynamsoft.WebTwain#CaptureImage
|
||||
* @param {function} OnCaptureSuccess he function to call when the capture succeeds. Please refer to the function prototype OnCaptureSuccess.
|
||||
* @param {function} OnCaptureError The function to call when the capture fails. Please refer to the function prototype OnCaptureError.
|
||||
* @return {void}
|
||||
*/
|
||||
CaptureImage(OnCaptureSuccess: () => void, OnCaptureError: () => void): void;
|
||||
|
||||
/**
|
||||
* Returns the media type for a camera.
|
||||
* @method Dynamsoft.WebTwain#GetMediaType
|
||||
* @return {class MediaType}
|
||||
*/
|
||||
GetMediaType(): WebcamMediaType;
|
||||
|
||||
/**
|
||||
* Returns the count in the media type list.
|
||||
* @method Dynamsoft.WebTwain#GetResolution
|
||||
* @return {class Resolution}
|
||||
*/
|
||||
GetResolution(): WebcamResolution;
|
||||
|
||||
/**
|
||||
* Returns the frame rate for a camera.
|
||||
* @method Dynamsoft.WebTwain#GetFrameRate
|
||||
* @return {class FrameRate}
|
||||
*/
|
||||
GetFrameRate(): WebcamFrameRate;
|
||||
|
||||
/**
|
||||
* Set the media type of the current selected source by the value.
|
||||
* @method Dynamsoft.WebTwain#SetMediaType
|
||||
* @param {string} value The new media type value.
|
||||
* @return {boolean}
|
||||
*/
|
||||
SetMediaType(value: string): boolean;
|
||||
|
||||
/**
|
||||
* Set the resolution of the current camera source.
|
||||
* @method Dynamsoft.WebTwain#SetResolution
|
||||
* @param {string} value The new resolution value.
|
||||
* @return {boolean}
|
||||
*/
|
||||
SetResolution(value: string): boolean;
|
||||
|
||||
/**
|
||||
* Set current frame rate.
|
||||
* @method Dynamsoft.WebTwain#SetFrameRate
|
||||
* @param {number} value The new frame rate value.
|
||||
* @return {boolean}
|
||||
*/
|
||||
SetFrameRate(value: number): boolean;
|
||||
|
||||
/**
|
||||
* Gets the current setting of a video property.
|
||||
* @method Dynamsoft.WebTwain#GetVideoPropertySetting
|
||||
* @param {EnumDWT_VideoProperty} property The property.
|
||||
* @return {class VideoPropertySetting}
|
||||
*/
|
||||
GetVideoPropertySetting(property: EnumDWT_VideoProperty): VideoPropertySetting;
|
||||
|
||||
/**
|
||||
* Gets the range and default value of a specified video property.
|
||||
* @method Dynamsoft.WebTwain#GetVideoPropertyMoreSetting
|
||||
* @param {EnumDWT_VideoProperty} property The property.
|
||||
* @return {class VideoPropertyMoreSetting}
|
||||
*/
|
||||
GetVideoPropertyMoreSetting(property: EnumDWT_VideoProperty): VideoPropertyMoreSetting;
|
||||
|
||||
/**
|
||||
* Gets the current setting of a camera property.
|
||||
* @method Dynamsoft.WebTwain#GetCameraControlPropertySetting
|
||||
* @param {EnumDWT_CameraControlProperty} property The property.
|
||||
* @return {class CameraControlPropertySetting}
|
||||
*/
|
||||
GetCameraControlPropertySetting(property: EnumDWT_CameraControlProperty): CameraControlSetting;
|
||||
|
||||
/**
|
||||
* Gets the range and default value of a specified camera property.
|
||||
* @method Dynamsoft.WebTwain#GetVideoPropertyMoreSetting
|
||||
* @param {EnumDWT_CameraControlProperty} property The property.
|
||||
* @return {class CameraControlPropertyMoreSetting}
|
||||
*/
|
||||
GetCameraControlPropertyMoreSetting(property: EnumDWT_CameraControlProperty): CameraControlMoreSetting;
|
||||
|
||||
/**
|
||||
* Sets video quality for a specified property.
|
||||
* @method Dynamsoft.WebTwain#SetVideoPropertySetting
|
||||
* @param {EnumDWT_VideoProperty} property The property.
|
||||
* @param {number} value The new value of the property.
|
||||
* @param {boolean} auto The desired control setting, whether the setting is controlled manually or automatically.
|
||||
* @return {boolean}
|
||||
*/
|
||||
SetVideoPropertySetting(property: EnumDWT_VideoProperty, value: number, auto: boolean): boolean;
|
||||
|
||||
/**
|
||||
* Sets video rotate mode.
|
||||
* @method Dynamsoft.WebTwain#SetVideoRotateMode
|
||||
* @param {EnumDWT_VideoRotateMode} enumAngle The rotate angle.
|
||||
* @return {boolean}
|
||||
*/
|
||||
SetVideoRotateMode(enumAngle: EnumDWT_VideoRotateMode): boolean;
|
||||
|
||||
/**
|
||||
* Sets a specified property on the camera.
|
||||
* @method Dynamsoft.WebTwain#SetCameraControlPropertySetting
|
||||
* @param {EnumDWT_CameraControlProperty} property The property.
|
||||
* @param {number} value The new value of the property.
|
||||
* @param {boolean} auto The desired control setting, whether the setting is controlled manually or automatically.
|
||||
* @return {boolean}
|
||||
*/
|
||||
SetCameraControlPropertySetting(property: EnumDWT_CameraControlProperty, value: number, auto: boolean): boolean;
|
||||
}
|
||||
|
||||
interface WebTwainAddon {
|
||||
Webcam: Webcam;
|
||||
}
|
||||
Vendored
+192
@@ -0,0 +1,192 @@
|
||||
interface RunTimeSetting {
|
||||
mAntiDamageLevel: number;
|
||||
mBarcodeFormatIds: number;
|
||||
mBarcodeInvertMode: number;
|
||||
mBinarizationBlockSize: number;
|
||||
mColourImageConvertMode: number;
|
||||
mDeblurLevel: number;
|
||||
mEnableFillBinaryVacancy: number;
|
||||
mExpectedBarcodesCount: number;
|
||||
mGrayEqualizationSensitivity: number;
|
||||
mLocalizationAlgorithmPriority: string;
|
||||
mMaxAlgorithmThreadCount: number;
|
||||
mMaxBarcodesCount: number;
|
||||
mMaxDimOfFullImageAsBarcodeZone: number;
|
||||
mPDFRasterDPI: number;
|
||||
mRegionPredetectionMode: number;
|
||||
mReserved: string;
|
||||
mScaleDownThreshold: number;
|
||||
mTextFilterMode: number;
|
||||
mTextureDetectionSensitivity: number;
|
||||
mTimeout: number;
|
||||
}
|
||||
|
||||
interface dbrEnv {
|
||||
bAutoConnectService: boolean;
|
||||
logLevel: number;
|
||||
productKey: string;
|
||||
resourcesPath: string;
|
||||
onAutoConnectServiceSuccess(): void;
|
||||
onAutoConnectServiceError(status: any): void;
|
||||
}
|
||||
|
||||
declare namespace dynamsoft {
|
||||
let TaskQueue: TaskQueue;
|
||||
let dbrEnv: dbrEnv;
|
||||
/**dbrMasterPage20170526 */
|
||||
let dcp: {
|
||||
ifCheck64bitServiceFirst: boolean;
|
||||
};
|
||||
/**dwtDbrDemo20170613 */
|
||||
let initOrder: any;
|
||||
let lib: any;
|
||||
let managerEnv: any;
|
||||
let navInfo: any;
|
||||
namespace BarcodeReader {
|
||||
/** Barcode Formats */
|
||||
enum EnumBarcodeFormat {
|
||||
All = 503317503,
|
||||
OneD = 0x3FF,
|
||||
CODE_39 = 0x1,
|
||||
CODE_128 = 0x2,
|
||||
CODE_93 = 0x4,
|
||||
CODABAR = 0x8,
|
||||
ITF = 0x10,
|
||||
EAN_13 = 0x20,
|
||||
EAN_8 = 0x40,
|
||||
UPC_A = 0x80,
|
||||
UPC_E = 0x100,
|
||||
INDUSTRIAL_25 = 0x200,
|
||||
PDF417 = 0x2000000,
|
||||
QR_CODE = 0x4000000,
|
||||
DATAMATRIX = 0x8000000,
|
||||
AZTEC = 0x10000000
|
||||
}
|
||||
|
||||
enum EnumErrorCode {
|
||||
DBR_SYSTEM_EXCEPTION = 1,
|
||||
DBR_SUCCESS = 0,
|
||||
DBR_UNKNOWN = -10000,
|
||||
DBR_NO_MEMORY = -10001,
|
||||
DBR_NULL_REFERENCE = -10002,
|
||||
DBR_LICENSE_INVALID = -10003,
|
||||
DBR_LICENSE_EXPIRED = -10004,
|
||||
DBR_FILE_NOT_FOUND = -10005,
|
||||
DBR_FILETYPE_NOT_SUPPORTED = -10006,
|
||||
DBR_BPP_NOT_SUPPORTED = -10007,
|
||||
DBR_INDEX_INVALID = -10008,
|
||||
DBR_BARCODE_FORMAT_INVALID = -10009,
|
||||
DBR_CUSTOM_REGION_INVALID = -10010,
|
||||
DBR_MAX_BARCODE_NUMBER_INVALID = -10011,
|
||||
DBR_IMAGE_READ_FAILED = -10012,
|
||||
DBR_TIFF_READ_FAILED = -10013,
|
||||
DBR_QR_LICENSE_INVALID = -10016,
|
||||
DBR_1D_LICENSE_INVALID = -10017,
|
||||
DBR_DIB_BUFFER_INVALID = -10018,
|
||||
DBR_PDF417_LICENSE_INVALID = 10019,
|
||||
DBR_DATAMATRIX_LICENSE_INVALID = -10020,
|
||||
DBR_PDF_READ_FAILED = -10021,
|
||||
DBR_PDF_DLL_MISSING = -10022,
|
||||
DBR_PAGE_NUMBER_INVALID = -10023,
|
||||
DBR_CUSTOM_SIZE_INVALID = -10024,
|
||||
DBR_CUSTOM_MODULESIZE_INVALID = -10025,
|
||||
DBR_RECOGNITION_TIMEOUT = -10026,
|
||||
DBR_JSON_PARSE_FAILED = -10030,
|
||||
DBR_JSON_TYPE_INVALID = -10031,
|
||||
DBR_JSON_KEY_INVALID = -10032,
|
||||
DBR_JSON_VALUE_INVALID = -10033,
|
||||
DBR_JSON_NAME_KEY_MISSING = -10034,
|
||||
DBR_JSON_NAME_VALUE_DUPLICATED = -10035,
|
||||
DBR_TEMPLATE_NAME_INVALID = -10036,
|
||||
DBR_JSON_NAME_REFERENCE_INVALID = -10037,
|
||||
DBR_PARAMETER_VALUE_INVALID = 10038,
|
||||
DBR_DOMAIN_NOT_MATCHED = -10039,
|
||||
DBR_RESERVEDINFO_NOT_MATCHED = -10040,
|
||||
DBR_DBRERR_AZTEC_LICENSE_INVALID = -10041
|
||||
}
|
||||
enum EnumConflictMode {
|
||||
ECM_Ignore = 1,
|
||||
ECM_Overwrite = 2
|
||||
}
|
||||
enum EnumImagePixelFormat {
|
||||
IPF_Binary = 0,
|
||||
IPF_BinaryInverted = 1,
|
||||
IPF_GrayScaled = 2,
|
||||
IPF_NV21 = 3,
|
||||
IPF_RGB_565 = 4,
|
||||
IPF_RGB_555 = 5,
|
||||
IPF_RGB_888 = 6,
|
||||
IPF_ARGB_8888 = 7
|
||||
}
|
||||
enum EnumResultType {
|
||||
EDT_CandidateText = 2,
|
||||
EDT_PartialText = 3,
|
||||
EDT_RawText = 1,
|
||||
EDT_StandardText = 0
|
||||
}
|
||||
enum EnumTerminateStage {
|
||||
ETS_Localized = 1,
|
||||
ETS_Prelocalized = 0,
|
||||
ETS_Recognized = 2
|
||||
}
|
||||
}
|
||||
|
||||
class BarcodeReader {
|
||||
static BarcodeReaderException(): any;
|
||||
static initServiceConnection(): Promise<any>;
|
||||
static name: string;
|
||||
static length: number;
|
||||
static version: string;
|
||||
// appendTplStringToRuntimeSettings(b, d):
|
||||
/**
|
||||
* Read barcode from the source image.
|
||||
* @method BarcodeReader#decode
|
||||
* @param {string} source specifies the image to read on
|
||||
* @return {Promise}
|
||||
* @example
|
||||
```javascript
|
||||
// dwtUrl: HTML5 Edition only
|
||||
reader.decode('dwt://dwt_trial_13000404/img?id=306159652&index=0&t=1502184632022').then(
|
||||
results=>{
|
||||
for(var i = 0; i < results.length; ++i){
|
||||
console.log(results[i].BarcodeText);
|
||||
// Confidence >= 30 is reliable
|
||||
console.log(results[i].LocalizationResult.ExtendedResultArray[0].Confidence);
|
||||
}
|
||||
});
|
||||
// dcsUrl
|
||||
reader.decode('dcs://dcs_trial_6110531/img?id=306159652&index=0&t=1502184632022').then(
|
||||
function(results){
|
||||
// ie6-7 does not support console.log
|
||||
var messageArr = [];
|
||||
for(var i = 0; i < results.length; ++i){
|
||||
messageArr.push(results[i].BarcodeText);
|
||||
// Confidence >= 30 is reliable
|
||||
messageArr.push(results[i].LocalizationResult.ExtendedResultArray[0].Confidence);
|
||||
}
|
||||
alert(messageArr.join(''));
|
||||
})['catch'](function(ex){
|
||||
// ie6-9 does not support '.catch(function(ex){...})'
|
||||
if(ex){alert(ex.message||ex);}
|
||||
});
|
||||
```
|
||||
*/
|
||||
decode(source: string): Promise<any>;
|
||||
|
||||
/**
|
||||
* Read barcode from base64 string
|
||||
*/
|
||||
decodeBase64String(base64String: string): Promise<any>;
|
||||
getAllLocalizationResults(): any;
|
||||
getAllParameterTemplateNames(): any;
|
||||
getRuntimeSettings(): RunTimeSetting;
|
||||
initRuntimeSettingsWithString(): any;
|
||||
outputSettingsToString(): any;
|
||||
resetRuntimeSettings(): void;
|
||||
updateRuntimeSettings(setting: RunTimeSetting): void;
|
||||
/**
|
||||
* Constructs a new barcode reader
|
||||
*/
|
||||
constructor(dbrKey?: string);
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user