mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 14:20:12 +00:00
Merge branch 'master' of https://github.com/segayuu/DefinitelyTyped into cleanup-bluebird-ignore-error
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import * as angular from 'angular';
|
||||
import { angulartics } from 'angulartics';
|
||||
import * as angulartics from 'angulartics';
|
||||
|
||||
namespace Analytics {
|
||||
angular.module("angulartics.app", ["angulartics"])
|
||||
|
||||
49
types/angulartics/index.d.ts
vendored
49
types/angulartics/index.d.ts
vendored
@@ -1,11 +1,14 @@
|
||||
// Type definitions for Angulartics 1.3
|
||||
// Type definitions for Angulartics 1.4
|
||||
// Project: http://luisfarzati.github.io/angulartics/
|
||||
// Definitions by: Steven Fan <https://github.com/stevenfan>
|
||||
// Bateast2 <https://github.com/bateast2>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
import * as angular from 'angular';
|
||||
|
||||
export = angulartics;//AMD/Require module support
|
||||
export as namespace angulartics;//UMD module support
|
||||
declare namespace angulartics {
|
||||
|
||||
interface IAngularticsStatic {
|
||||
@@ -13,41 +16,67 @@ declare namespace angulartics {
|
||||
}
|
||||
|
||||
interface IAnalyticsService {
|
||||
eventTrack(eventName: string, properties?: any): any;
|
||||
getOptOut(): boolean;
|
||||
pageTrack(path: string, location?: angular.ILocationService): any;
|
||||
eventTrack(eventName: string, properties?: any): any;
|
||||
exceptionTrack(error: any, cause: string): any;
|
||||
transactionTrack: any;
|
||||
setAlias(alias: string): any;
|
||||
setOptOut(value: boolean): void;
|
||||
setUsername(username: string): any;
|
||||
setUserProperties(properties: any): any;
|
||||
setSuperProperties(properties: any): any;
|
||||
setUserProperties(userProperties: any): any;
|
||||
setUserPropertiesOnce(userProperties: any): any;
|
||||
setSuperProperties(superProperties: any): any;
|
||||
setSuperPropertiesOnce(superProperties: any): any;
|
||||
incrementProperty(property: string, value?: any): any;
|
||||
userTimings(properties: any): any;
|
||||
clearCookies: any;
|
||||
|
||||
getOptOut(): boolean;
|
||||
setOptOut(value: boolean): void;
|
||||
}
|
||||
|
||||
interface IAnalyticsServiceProvider extends angular.IServiceProvider {
|
||||
virtualPageviews(value: boolean): void;
|
||||
trackStates(value: boolean): void;
|
||||
trackRoutes(value: boolean): void;
|
||||
excludeRoutes(value: string[]): void;
|
||||
queryKeysWhitelist(keys: string[]): void
|
||||
queryKeysBlacklist(keys: string[]): void
|
||||
firstPageview(value: boolean): void;
|
||||
withBase(value: boolean): void;
|
||||
withAutoBase(value: boolean): void;
|
||||
developerMode(value: boolean): void;
|
||||
trackExceptions(value: boolean): void;
|
||||
trackRoutes(value: boolean): void;
|
||||
trackStates(value: boolean): void;
|
||||
developerMode(value: boolean): void;
|
||||
|
||||
registerPageTrack(callback: (path: string, location?: angular.ILocationService) => any): void;
|
||||
registerEventTrack(callback: (eventName: string, properties?: any) => any): void;
|
||||
registerTransactionTrack(callback: any): void;
|
||||
registerSetAlias(callback: (alias: string) => any): void;
|
||||
registerSetUsername(callback: (username: string) => any): void;
|
||||
registerSetUserProperties(callback: (userProperties: any) => any): void;
|
||||
registerSetUserPropertiesOnce(callback: (userProperties: any) => any): void;
|
||||
registerSetSuperProperties(callback: (superProperties: any) => any): void;
|
||||
registerSetSuperPropertiesOnce(callback: (superProperties: any) => any): void;
|
||||
registerIncrementProperty(callback: (property: string, value?: any) => any): void;
|
||||
registerUserTimings(callback: (properties: any) => any): void;
|
||||
registerClearCookies(callback: any): void;
|
||||
|
||||
settings: {
|
||||
pageTracking: {
|
||||
autoTrackingVirtualPages: boolean,
|
||||
autoTrackingFirstPage: boolean,
|
||||
trackRelativePath: boolean,
|
||||
trackRoutes: boolean,
|
||||
trackStates: boolean,
|
||||
autoBasePath: boolean,
|
||||
basePath: string,
|
||||
autoBasePath: boolean
|
||||
excludedRoutes: string[],
|
||||
queryKeysWhitelisted: string[],
|
||||
queryKeysBlacklisted: string[]
|
||||
},
|
||||
eventTracking: {},
|
||||
bufferFlushDelay: number,
|
||||
trackExceptions: boolean,
|
||||
optOut: boolean,
|
||||
developerMode: boolean
|
||||
};
|
||||
}
|
||||
|
||||
95
types/binary-parser/binary-parser-tests.ts
Normal file
95
types/binary-parser/binary-parser-tests.ts
Normal file
@@ -0,0 +1,95 @@
|
||||
import { Parser } from "binary-parser";
|
||||
|
||||
// Build an IP packet header Parser
|
||||
const ipHeader = new Parser()
|
||||
.endianess('big')
|
||||
.bit4('version')
|
||||
.bit4('headerLength')
|
||||
.uint8('tos')
|
||||
.uint16('packetLength')
|
||||
.uint16('id')
|
||||
.bit3('offset')
|
||||
.bit13('fragOffset')
|
||||
.uint8('ttl')
|
||||
.uint8('protocol')
|
||||
.uint16('checksum')
|
||||
.array('src', {
|
||||
type: 'uint8',
|
||||
length: 4
|
||||
})
|
||||
.array('dst', {
|
||||
type: 'uint8',
|
||||
length: 4
|
||||
});
|
||||
|
||||
// Prepare buffer to parse.
|
||||
const buf = new Buffer('450002c5939900002c06ef98adc24f6c850186d1', 'hex');
|
||||
|
||||
// Parse buffer and show result
|
||||
ipHeader.parse(buf);
|
||||
|
||||
const parser2 = new Parser()
|
||||
// Signed 32-bit integer (little endian)
|
||||
.int32le('a')
|
||||
// Unsigned 8-bit integer
|
||||
.uint8('b')
|
||||
// Signed 16-bit integer (big endian)
|
||||
.int16be('c');
|
||||
|
||||
const parser3 = new Parser()
|
||||
// 32-bit floating value (big endian)
|
||||
.floatbe('a')
|
||||
// 64-bit floating value (little endian)
|
||||
.doublele('b');
|
||||
|
||||
const parser4 = new Parser()
|
||||
// Statically sized array
|
||||
.array('data', {
|
||||
type: 'int32',
|
||||
length: 8
|
||||
})
|
||||
|
||||
// Dynamically sized array (references another variable)
|
||||
.uint8('dataLength')
|
||||
.array('data2', {
|
||||
type: 'int32',
|
||||
length: 'dataLength'
|
||||
})
|
||||
|
||||
// Dynamically sized array (with some calculation)
|
||||
.array('data3', {
|
||||
type: 'int32',
|
||||
length: () => 4 // other fields are available through this
|
||||
})
|
||||
|
||||
// Statically sized array
|
||||
.array('data4', {
|
||||
type: 'int32',
|
||||
lengthInBytes: 16
|
||||
})
|
||||
|
||||
// Dynamically sized array (references another variable)
|
||||
.uint8('dataLengthInBytes')
|
||||
.array('data5', {
|
||||
type: 'int32',
|
||||
lengthInBytes: 'dataLengthInBytes'
|
||||
})
|
||||
|
||||
// Dynamically sized array (with some calculation)
|
||||
.array('data6', {
|
||||
type: 'int32',
|
||||
lengthInBytes: () => 4, // other fields are available through this
|
||||
})
|
||||
|
||||
// Dynamically sized array (with stop-check on parsed item)
|
||||
.array('data7', {
|
||||
type: 'int32',
|
||||
readUntil: (item, buffer) => true // stop when specific item is parsed. buffer can be used to perform a read-ahead.
|
||||
});
|
||||
|
||||
const parser5 = new Parser()
|
||||
.array('ipv4', {
|
||||
type: 'uint8',
|
||||
length: '4',
|
||||
formatter: (arr) => { }
|
||||
});
|
||||
147
types/binary-parser/index.d.ts
vendored
Normal file
147
types/binary-parser/index.d.ts
vendored
Normal file
@@ -0,0 +1,147 @@
|
||||
// Type definitions for binary-parser 1.3
|
||||
// Project: https://github.com/keichi/binary-parser
|
||||
// Definitions by: Benjamin Riggs <https://github.com/riggs>, Dolan Miu <https://github.com/dolanmiu>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
export interface Parser {
|
||||
parse(buffer: Buffer, callback?: (err?: Error, result?: any) => void): Parser.Parsed;
|
||||
|
||||
create(constructorFunction: ObjectConstructor): Parser;
|
||||
|
||||
int8(name: string, options?: Parser.Options): Parser;
|
||||
uint8(name: string, options?: Parser.Options): Parser;
|
||||
|
||||
int16(name: string, options?: Parser.Options): Parser;
|
||||
uint16(name: string, options?: Parser.Options): Parser;
|
||||
int16le(name: string, options?: Parser.Options): Parser;
|
||||
int16be(name: string, options?: Parser.Options): Parser;
|
||||
uint16le(name: string, options?: Parser.Options): Parser;
|
||||
uint16be(name: string, options?: Parser.Options): Parser;
|
||||
|
||||
int32(name: string, options?: Parser.Options): Parser;
|
||||
uint32(name: string, options?: Parser.Options): Parser;
|
||||
int32le(name: string, options?: Parser.Options): Parser;
|
||||
int32be(name: string, options?: Parser.Options): Parser;
|
||||
uint32le(name: string, options?: Parser.Options): Parser;
|
||||
uint32be(name: string, options?: Parser.Options): Parser;
|
||||
|
||||
bit1(name: string, options?: Parser.Options): Parser;
|
||||
bit2(name: string, options?: Parser.Options): Parser;
|
||||
bit3(name: string, options?: Parser.Options): Parser;
|
||||
bit4(name: string, options?: Parser.Options): Parser;
|
||||
bit5(name: string, options?: Parser.Options): Parser;
|
||||
bit6(name: string, options?: Parser.Options): Parser;
|
||||
bit7(name: string, options?: Parser.Options): Parser;
|
||||
bit8(name: string, options?: Parser.Options): Parser;
|
||||
bit9(name: string, options?: Parser.Options): Parser;
|
||||
bit10(name: string, options?: Parser.Options): Parser;
|
||||
bit11(name: string, options?: Parser.Options): Parser;
|
||||
bit12(name: string, options?: Parser.Options): Parser;
|
||||
bit13(name: string, options?: Parser.Options): Parser;
|
||||
bit14(name: string, options?: Parser.Options): Parser;
|
||||
bit15(name: string, options?: Parser.Options): Parser;
|
||||
bit16(name: string, options?: Parser.Options): Parser;
|
||||
bit17(name: string, options?: Parser.Options): Parser;
|
||||
bit18(name: string, options?: Parser.Options): Parser;
|
||||
bit19(name: string, options?: Parser.Options): Parser;
|
||||
bit20(name: string, options?: Parser.Options): Parser;
|
||||
bit21(name: string, options?: Parser.Options): Parser;
|
||||
bit22(name: string, options?: Parser.Options): Parser;
|
||||
bit23(name: string, options?: Parser.Options): Parser;
|
||||
bit24(name: string, options?: Parser.Options): Parser;
|
||||
bit25(name: string, options?: Parser.Options): Parser;
|
||||
bit26(name: string, options?: Parser.Options): Parser;
|
||||
bit27(name: string, options?: Parser.Options): Parser;
|
||||
bit28(name: string, options?: Parser.Options): Parser;
|
||||
bit29(name: string, options?: Parser.Options): Parser;
|
||||
bit30(name: string, options?: Parser.Options): Parser;
|
||||
bit31(name: string, options?: Parser.Options): Parser;
|
||||
bit32(name: string, options?: Parser.Options): Parser;
|
||||
|
||||
float(name: string, options?: Parser.Options): Parser;
|
||||
floatle(name: string, options?: Parser.Options): Parser;
|
||||
floatbe(name: string, options?: Parser.Options): Parser;
|
||||
|
||||
double(name: string, options?: Parser.Options): Parser;
|
||||
doublele(name: string, options?: Parser.Options): Parser;
|
||||
doublebe(name: string, options?: Parser.Options): Parser;
|
||||
|
||||
string(name: string, options?: Parser.StringOptions): Parser;
|
||||
|
||||
buffer(name: string, options: Parser.BufferOptions): Parser;
|
||||
|
||||
array(name: string, options: Parser.ArrayOptions): Parser;
|
||||
|
||||
choice(name: string, options: Parser.ChoiceOptions): Parser;
|
||||
|
||||
nest(name: string, options: Parser.NestOptions): Parser;
|
||||
|
||||
skip(length: number): Parser;
|
||||
|
||||
endianess(endianess: Parser.Endianness): Parser; /* [sic] */
|
||||
|
||||
namely(alias: string): Parser;
|
||||
|
||||
compile(): void;
|
||||
|
||||
getCode(): string;
|
||||
}
|
||||
|
||||
export interface ParserConstructor {
|
||||
new(): Parser;
|
||||
}
|
||||
|
||||
export const Parser: ParserConstructor;
|
||||
|
||||
export namespace Parser {
|
||||
type Data = number | string | Array<number | Parsed> | Parsed | Buffer;
|
||||
interface Parsed {
|
||||
[name: string]: Data;
|
||||
}
|
||||
|
||||
interface Options {
|
||||
formatter?: ((value: Data) => any);
|
||||
assert?: string | number | ((value: Data) => boolean);
|
||||
}
|
||||
|
||||
interface StringOptions extends Options {
|
||||
encoding?: string;
|
||||
length?: number | string | ((this: Parsed) => number);
|
||||
zeroTerminated?: boolean;
|
||||
greedy?: boolean;
|
||||
stripNull?: boolean;
|
||||
}
|
||||
|
||||
interface BufferOptions extends Options {
|
||||
clone?: boolean;
|
||||
length?: number | string | ((this: Parsed) => number);
|
||||
readUntil?: string | ((item: number, buffer: Buffer) => boolean);
|
||||
}
|
||||
|
||||
interface ArrayOptions extends Options {
|
||||
type: string | Parser;
|
||||
length?: number | string | ((this: Parsed) => number);
|
||||
lengthInBytes?: number | string | ((this: Parsed) => number);
|
||||
readUntil?: string | ((item: number, buffer: Buffer) => boolean);
|
||||
}
|
||||
|
||||
interface ChoiceOptions extends Options {
|
||||
tag: string | ((this: Parsed) => number);
|
||||
choices: { [item: number]: Parser | string };
|
||||
defaultChoice?: Parser | string;
|
||||
}
|
||||
|
||||
interface NestOptions extends Options {
|
||||
type: Parser | string;
|
||||
}
|
||||
|
||||
type Endianness =
|
||||
'little' |
|
||||
'big';
|
||||
|
||||
interface Context {
|
||||
[name: string]: Parsed;
|
||||
}
|
||||
}
|
||||
23
types/binary-parser/tsconfig.json
Normal file
23
types/binary-parser/tsconfig.json
Normal file
@@ -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",
|
||||
"binary-parser-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/binary-parser/tslint.json
Normal file
1
types/binary-parser/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
3
types/cheerio/index.d.ts
vendored
3
types/cheerio/index.d.ts
vendored
@@ -1,6 +1,6 @@
|
||||
// Type definitions for Cheerio v0.22.0
|
||||
// Project: https://github.com/cheeriojs/cheerio
|
||||
// Definitions by: Bret Little <https://github.com/blittle>, VILIC VANE <http://vilic.info>, Wayne Maurer <https://github.com/wmaurer>, Umar Nizamani <https://github.com/umarniz>
|
||||
// Definitions by: Bret Little <https://github.com/blittle>, VILIC VANE <http://vilic.info>, Wayne Maurer <https://github.com/wmaurer>, Umar Nizamani <https://github.com/umarniz>, LiJinyao <https://github.com/LiJinyao>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
interface Cheerio {
|
||||
@@ -255,6 +255,7 @@ interface CheerioElement {
|
||||
children: CheerioElement[];
|
||||
childNodes: CheerioElement[];
|
||||
lastChild: CheerioElement;
|
||||
firstChild: CheerioElement;
|
||||
next: CheerioElement;
|
||||
nextSibling: CheerioElement;
|
||||
prev: CheerioElement;
|
||||
|
||||
18
types/chrome/index.d.ts
vendored
18
types/chrome/index.d.ts
vendored
@@ -1426,8 +1426,7 @@ declare namespace chrome.declarativeContent {
|
||||
ports?: (number | number[])[];
|
||||
}
|
||||
|
||||
/** Matches the state of a web page by various criteria. */
|
||||
interface PageStateMatcher {
|
||||
class PageStateMatcherProperties {
|
||||
/** Optional. Filters URLs for various criteria. See event filtering. All criteria are case sensitive. */
|
||||
pageUrl?: PageStateUrlDetails;
|
||||
/** Optional. Matches if all of the CSS selectors in the array match displayed elements in a frame with the same origin as the page's main frame. All selectors in this array must be compound selectors to speed up matching. Note that listing hundreds of CSS selectors or CSS selectors that match hundreds of times per page can still slow down web sites. */
|
||||
@@ -1439,6 +1438,19 @@ declare namespace chrome.declarativeContent {
|
||||
*/
|
||||
isBookmarked?: boolean;
|
||||
}
|
||||
|
||||
/** Matches the state of a web page by various criteria. */
|
||||
class PageStateMatcher {
|
||||
constructor(options: PageStateMatcherProperties);
|
||||
}
|
||||
|
||||
/** Declarative event action that shows the extension's page action while the corresponding conditions are met. */
|
||||
class ShowPageAction {}
|
||||
|
||||
/** Provides the Declarative Event API consisting of addRules, removeRules, and getRules. */
|
||||
interface PageChangedEvent extends chrome.events.Event<() => void> {}
|
||||
|
||||
var onPageChanged: PageChangedEvent;
|
||||
}
|
||||
|
||||
////////////////////
|
||||
@@ -5126,7 +5138,7 @@ declare namespace chrome.runtime {
|
||||
actions?: {
|
||||
type: string;
|
||||
}[];
|
||||
conditions?: chrome.declarativeContent.PageStateMatcher[]
|
||||
conditions?: chrome.declarativeContent.PageStateMatcherProperties[]
|
||||
}[];
|
||||
externally_connectable?: {
|
||||
ids?: string[];
|
||||
|
||||
@@ -52,6 +52,23 @@ function test_config() {
|
||||
[ 'list', 'indent', 'blocks', 'align', 'bidi' ],
|
||||
],
|
||||
};
|
||||
var config3: CKEDITOR.config = {
|
||||
toolbarGroups: [
|
||||
{ name: 'clipboard', groups: [ 'clipboard', 'undo' ] },
|
||||
{ name: 'editing', groups: [ 'find', 'selection', 'spellchecker', 'editing' ] },
|
||||
{ name: 'links', groups: [ 'links' ] },
|
||||
{ name: 'insert', groups: [ 'insert' ] },
|
||||
{ name: 'tools', groups: [ 'tools' ] },
|
||||
{ name: 'document', groups: [ 'mode' ] },
|
||||
{ name: 'about', groups: [ 'about' ] },
|
||||
'/',
|
||||
{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },
|
||||
{ name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'paragraph' ] },
|
||||
'/',
|
||||
{ name: 'styles', groups: [ 'styles' ] },
|
||||
{ name: 'colors', groups: [ 'colors' ] },
|
||||
],
|
||||
}
|
||||
}
|
||||
|
||||
function test_dom_comment() {
|
||||
|
||||
3
types/ckeditor/index.d.ts
vendored
3
types/ckeditor/index.d.ts
vendored
@@ -1,6 +1,7 @@
|
||||
// Type definitions for CKEditor
|
||||
// Project: http://ckeditor.com/
|
||||
// Definitions by: Ondrej Sevcik <https://github.com/ondrejsevcik>
|
||||
// Thomas Wittwer <https://github.com/wittwert>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
// WORK-IN-PROGRESS: Any contribution support welcomed.
|
||||
@@ -814,7 +815,7 @@ declare namespace CKEDITOR {
|
||||
toolbar?: string | (string | string[])[];
|
||||
toolbarCanCollapse?: boolean;
|
||||
toolbarGroupCycling?: boolean;
|
||||
toolbarGroups?: toolbarGroups[];
|
||||
toolbarGroups?: (toolbarGroups | string)[];
|
||||
toolbarLocation?: string;
|
||||
toolbarStartupExpanded?: boolean;
|
||||
|
||||
|
||||
5
types/croppie/index.d.ts
vendored
5
types/croppie/index.d.ts
vendored
@@ -2,6 +2,7 @@
|
||||
// Project: https://github.com/Foliotek/Croppie
|
||||
// Definitions by: Connor Peet <https://github.com/connor4312>
|
||||
// dklmuc <https://github.com/dklmuc>
|
||||
// Sarun Intaralawan <https://github.com/sarunint>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export default class Croppie {
|
||||
@@ -15,10 +16,10 @@ export default class Croppie {
|
||||
useCanvas?: boolean,
|
||||
}): Promise<void>;
|
||||
|
||||
result(options: ResultOptions & { type: 'base64' }): Promise<string>;
|
||||
result(options: ResultOptions & { type: 'base64' | 'canvas' }): Promise<string>;
|
||||
result(options: ResultOptions & { type: 'html' }): Promise<HTMLElement>;
|
||||
result(options: ResultOptions & { type: 'blob' }): Promise<Blob>;
|
||||
result(options: ResultOptions & { type: 'canvas' }): Promise<HTMLCanvasElement>;
|
||||
result(options: ResultOptions & { type: 'rawcanvas' }): Promise<HTMLCanvasElement>;
|
||||
result(options?: ResultOptions): Promise<HTMLCanvasElement>;
|
||||
|
||||
rotate(degrees: 90 | 180 | 270 | -90 | -180 | -270): void;
|
||||
|
||||
@@ -118,10 +118,10 @@ var types = paymentCountByType.all();
|
||||
paymentsByTotal.dispose();
|
||||
|
||||
crossfilter.bisect([], null, 0, 0);
|
||||
var bisectBy = crossfilter.bisect.by(t => t);
|
||||
bisectBy([], null, 0, 0);
|
||||
bisectBy.left([], null, 0, 0);
|
||||
bisectBy.right([], null, 0, 0);
|
||||
var bisectBy = crossfilter.bisect.by<{value: string}, string>(t => t.value);
|
||||
bisectBy([{value: 'a'}, {value: 'b'}], 'c', 0, 0); // 2
|
||||
bisectBy.left([], 'string', 0, 0); // 0
|
||||
bisectBy.right([], 'string', 0, 0); // 0
|
||||
|
||||
crossfilter.heap([], 0, 0);
|
||||
var heapBy = crossfilter.heap.by(t => t);
|
||||
|
||||
14
types/crossfilter/index.d.ts
vendored
14
types/crossfilter/index.d.ts
vendored
@@ -1,6 +1,6 @@
|
||||
// Type definitions for CrossFilter
|
||||
// Project: https://github.com/square/crossfilter
|
||||
// Definitions by: Schmulik Raskin <https://github.com/schmuli>, Izaak Baker <https://github.com/iebaker>
|
||||
// Definitions by: Schmulik Raskin <https://github.com/schmuli>, Izaak Baker <https://github.com/iebaker>, Einar Norðfjörð <https://github.com/nordfjord>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare namespace CrossFilter {
|
||||
@@ -15,7 +15,7 @@ declare namespace CrossFilter {
|
||||
permute<T>(array: T[], index: number[]): T[];
|
||||
bisect: {
|
||||
<T>(array: T[], value: T, lo: number, hi: number): number;
|
||||
by<T>(value: Selector<T>): Bisector<T>;
|
||||
by<T,U>(accessor: (x: T)=> U): Bisector<T,U>;
|
||||
}
|
||||
heap: {
|
||||
<T>(array: T[], lo: number, hi: number): T[];
|
||||
@@ -36,13 +36,13 @@ declare namespace CrossFilter {
|
||||
}
|
||||
}
|
||||
|
||||
export interface Bisection<T> {
|
||||
(array: T[], value: T, lo: number, hi: number): number;
|
||||
export interface Bisection<T,U> {
|
||||
(array: T[], value: U, lo: number, hi: number): number;
|
||||
}
|
||||
|
||||
export interface Bisector<T> extends Bisection<T> {
|
||||
left: Bisection<T>
|
||||
right: Bisection<T>
|
||||
export interface Bisector<T,U> extends Bisection<T,U> {
|
||||
left: Bisection<T,U>
|
||||
right: Bisection<T,U>
|
||||
}
|
||||
|
||||
export interface Heap<T> {
|
||||
|
||||
@@ -121,6 +121,26 @@ let svgZoom: d3Zoom.ZoomBehavior<SVGRectElement, SVGDatum>;
|
||||
|
||||
svgZoom = d3Zoom.zoom<SVGRectElement, SVGDatum>();
|
||||
|
||||
// constrain() -------------------------------------------------------------
|
||||
|
||||
// chainable
|
||||
svgZoom = svgZoom.constrain((transform, extent, translateExtent) => {
|
||||
const t: d3Zoom.ZoomTransform = transform;
|
||||
const ve: [[number, number], [number, number]] = extent;
|
||||
const te: [[number, number], [number, number]] = translateExtent;
|
||||
const dx0 = t.invertX(ve[0][0]) - te[0][0];
|
||||
const dx1 = t.invertX(ve[1][0]) - te[1][0];
|
||||
const dy0 = transform.invertY(ve[0][1]) - te[0][1];
|
||||
const dy1 = transform.invertY(ve[1][1]) - te[1][1];
|
||||
return t.translate(
|
||||
dx1 > dx0 ? (dx0 + dx1) / 2 : Math.min(0, dx0) || Math.max(0, dx1),
|
||||
dy1 > dy0 ? (dy0 + dy1) / 2 : Math.min(0, dy0) || Math.max(0, dy1)
|
||||
);
|
||||
});
|
||||
|
||||
let constraintFn: (transform: d3Zoom.ZoomTransform, extent: [[number, number], [number, number]], translateExtent: [[number, number], [number, number]]) => d3Zoom.ZoomTransform;
|
||||
constraintFn = svgZoom.constrain();
|
||||
|
||||
// filter() ----------------------------------------------------------------
|
||||
|
||||
// chainable
|
||||
|
||||
19
types/d3-zoom/index.d.ts
vendored
19
types/d3-zoom/index.d.ts
vendored
@@ -1,9 +1,9 @@
|
||||
// Type definitions for d3JS d3-zoom module 1.6
|
||||
// Type definitions for d3JS d3-zoom module 1.7
|
||||
// Project: https://github.com/d3/d3-zoom/
|
||||
// Definitions by: Tom Wanzek <https://github.com/tomwanzek>, Alex Ford <https://github.com/gustavderdrache>, Boris Yankov <https://github.com/borisyankov>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
// Last module patch version validated against: 1.6.0
|
||||
// Last module patch version validated against: 1.7.0
|
||||
|
||||
import { ArrayLike, Selection, TransitionLike, ValueFn } from 'd3-selection';
|
||||
import { ZoomView, ZoomInterpolator } from 'd3-interpolate';
|
||||
@@ -499,6 +499,19 @@ export interface ZoomBehavior<ZoomRefElement extends ZoomedElementBaseType, Datu
|
||||
*/
|
||||
scaleTo(transition: TransitionLike<ZoomRefElement, Datum>, k: ValueFn<ZoomRefElement, Datum, number>): void;
|
||||
|
||||
/**
|
||||
* Returns the current constraint function.
|
||||
* The default implementation attempts to ensure that the viewport extent does not go outside the translate extent.
|
||||
*/
|
||||
constrain(): (transform: ZoomTransform, extent: [[number, number], [number, number]], translateExtent: [[number, number], [number, number]]) => ZoomTransform;
|
||||
/**
|
||||
* Sets the transform constraint function to the specified function and returns the zoom behavior.
|
||||
*
|
||||
* @param constraint A constraint function which returns a transform given the current transform, viewport extent and translate extent.
|
||||
* The default implementation attempts to ensure that the viewport extent does not go outside the translate extent.
|
||||
*/
|
||||
constrain(constraint: ((transform: ZoomTransform, extent: [[number, number], [number, number]], translateExtent: [[number, number], [number, number]]) => ZoomTransform)): this;
|
||||
|
||||
/**
|
||||
* Returns the current filter function.
|
||||
*/
|
||||
@@ -647,7 +660,7 @@ export interface ZoomBehavior<ZoomRefElement extends ZoomedElementBaseType, Datu
|
||||
/**
|
||||
* Set the maximum distance that the mouse can move between mousedown and mouseup that will trigger
|
||||
* a subsequent click event. If at any point between mousedown and mouseup the mouse is greater than or equal to
|
||||
* distance from its position on mousedown, the click event follwing mouseup will be suppressed.
|
||||
* distance from its position on mousedown, the click event following mouseup will be suppressed.
|
||||
*
|
||||
* @param distance The distance threshold between mousedown and mouseup measured in client coordinates (event.clientX and event.clientY).
|
||||
* The default is zero.
|
||||
|
||||
@@ -56,6 +56,7 @@ const dropzoneWithOptions = new Dropzone(".test", {
|
||||
dictRemoveFile: "",
|
||||
dictRemoveFileConfirmation: "",
|
||||
dictMaxFilesExceeded: "",
|
||||
dictFileSizeUnits: { tb: "", gb: "", mb: "", kb: "", b: "" },
|
||||
|
||||
accept: (file: Dropzone.DropzoneFile, done: (error?: string | Error) => void) => {
|
||||
if (file.accepted) {
|
||||
|
||||
9
types/dropzone/index.d.ts
vendored
9
types/dropzone/index.d.ts
vendored
@@ -26,6 +26,14 @@ declare namespace Dropzone {
|
||||
accepted: boolean;
|
||||
xhr?: XMLHttpRequest;
|
||||
}
|
||||
|
||||
export interface DropzoneDictFileSizeUnits {
|
||||
tb?: string;
|
||||
gb?: string;
|
||||
mb?: string;
|
||||
kb?: string;
|
||||
b?: string;
|
||||
}
|
||||
|
||||
export interface DropzoneOptions {
|
||||
url?: string;
|
||||
@@ -72,6 +80,7 @@ declare namespace Dropzone {
|
||||
dictRemoveFile?: string;
|
||||
dictRemoveFileConfirmation?: string;
|
||||
dictMaxFilesExceeded?: string;
|
||||
dictFileSizeUnits?: DropzoneDictFileSizeUnits;
|
||||
|
||||
accept?(file: DropzoneFile, done: (error?: string | Error) => void): void;
|
||||
init?(): void;
|
||||
|
||||
73
types/easeljs/index.d.ts
vendored
73
types/easeljs/index.d.ts
vendored
@@ -1,4 +1,4 @@
|
||||
// Type definitions for EaselJS 0.8.0
|
||||
// Type definitions for EaselJS 1.0.0
|
||||
// Project: http://www.createjs.com/#!/EaselJS
|
||||
// Definitions by: Pedro Ferreira <https://bitbucket.org/drk4>, Chris Smith <https://github.com/evilangelist>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
@@ -53,6 +53,22 @@ declare namespace createjs {
|
||||
clone(): Bitmap;
|
||||
}
|
||||
|
||||
export class BitmapCache {
|
||||
constructor();
|
||||
|
||||
// properties
|
||||
cacheID: number;
|
||||
|
||||
// methods
|
||||
static getFilterBounds(target: DisplayObject, output?: Rectangle): Rectangle;
|
||||
toString(): string;
|
||||
define(target: DisplayObject, x: number, y: number, width: number, height: number, scale?: number): void;
|
||||
update(compositeOperation?: string): void;
|
||||
release(): void;
|
||||
getCacheDataURL(): string;
|
||||
draw(ctx: CanvasRenderingContext2D): boolean;
|
||||
}
|
||||
|
||||
export class ScaleBitmap extends DisplayObject {
|
||||
constructor(imageOrUrl: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | Object | string, scale9Grid: Rectangle);
|
||||
|
||||
@@ -211,6 +227,7 @@ declare namespace createjs {
|
||||
|
||||
// properties
|
||||
alpha: number;
|
||||
bitmapCache: BitmapCache;
|
||||
cacheCanvas: HTMLCanvasElement | Object;
|
||||
cacheID: number;
|
||||
compositeOperation: string;
|
||||
@@ -924,6 +941,60 @@ declare namespace createjs {
|
||||
|
||||
}
|
||||
|
||||
interface IStageGLOptions {
|
||||
preserveBuffer?: boolean;
|
||||
antialias?: boolean;
|
||||
transparent?: boolean;
|
||||
premultiply?: boolean;
|
||||
autoPurge?: number;
|
||||
}
|
||||
|
||||
export class StageGL extends Stage {
|
||||
constructor(canvas: HTMLCanvasElement | string | Object, options?: IStageGLOptions);
|
||||
|
||||
// properties
|
||||
static VERTEX_PROPERTY_COUNT: number;
|
||||
static INDICIES_PER_CARD: number;
|
||||
static DEFAULT_MAX_BATCH_SIZE: number;
|
||||
static WEBGL_MAX_INDEX_NUM: number;
|
||||
static UV_RECT: number;
|
||||
static COVER_VERT: Float32Array;
|
||||
static COVER_UV: Float32Array;
|
||||
static COVER_UV_FLIP: Float32Array;
|
||||
static REGULAR_VARYING_HEADER: string;
|
||||
static REGULAR_VERTEX_HEADER: string;
|
||||
static REGULAR_FRAGMENT_HEADER: string;
|
||||
static REGULAR_VERTEX_BODY: string;
|
||||
static REGULAR_FRAGMENT_BODY: string;
|
||||
static REGULAR_FRAG_COLOR_NORMAL: string;
|
||||
static REGULAR_FRAG_COLOR_PREMULTIPLY: string;
|
||||
static PARTICLE_VERTEX_BODY: string;
|
||||
static PARTICLE_FRAGMENT_BODY: string;
|
||||
static COVER_VARYING_HEADER: string;
|
||||
static COVER_VERTEX_HEADER: string;
|
||||
static COVER_FRAGMENT_HEADER: string;
|
||||
static COVER_VERTEX_BODY: string;
|
||||
static COVER_FRAGMENT_BODY: string;
|
||||
isWebGL: boolean;
|
||||
autoPurge: number;
|
||||
vocalDebug: boolean;
|
||||
|
||||
// methods
|
||||
static buildUVRects(spritesheet: SpriteSheet, target?: number, onlyTarget?: boolean): Object;
|
||||
static isWebGLActive(ctx: CanvasRenderingContext2D): boolean;
|
||||
cacheDraw(target: DisplayObject, filters: Filter[], manager: BitmapCache): boolean;
|
||||
getBaseTexture(w?: number, h?: number): WebGLTexture | null;
|
||||
getFilterShader(filter: Filter | Object): WebGLProgram;
|
||||
getRenderBufferTexture (w: number, h: number): WebGLTexture;
|
||||
getTargetRenderTexture (target: DisplayObject, w: number, h: number): Object;
|
||||
protectTextureSlot(id: number, lock?: boolean): void;
|
||||
purgeTextures(count?: number): void;
|
||||
releaseTexture(item: DisplayObject | WebGLTexture | HTMLImageElement | HTMLCanvasElement): void;
|
||||
setTextureParams(gl: WebGLRenderingContext, isPOT?: boolean): void;
|
||||
updateSimultaneousTextureCount(count?: number): void;
|
||||
updateViewport(width: number, height: number): void;
|
||||
}
|
||||
|
||||
|
||||
export class Text extends DisplayObject {
|
||||
constructor(text?: string, font?: string, color?: string);
|
||||
|
||||
@@ -2,8 +2,9 @@ import electron = require('electron');
|
||||
import storage = require('electron-json-storage');
|
||||
|
||||
const DATA_PATH = '~/Downloads';
|
||||
const NEW_DATA_PATH = `${DATA_PATH}/new-data-path`;
|
||||
|
||||
console.log(storage.DEFAULT_DATA_PATH.length);
|
||||
console.log(storage.getDefaultDataPath().length);
|
||||
|
||||
storage.setDataPath(DATA_PATH);
|
||||
console.log(DATA_PATH.length);
|
||||
@@ -12,31 +13,59 @@ console.log(storage.getDataPath().length);
|
||||
|
||||
storage.set('foo', { foo: 'bar' }, (err: any) => { });
|
||||
storage.set('bar', { foo: 'bar' }, (err: any) => { });
|
||||
storage.set('baz', { foo: 'bar' }, {dataPath: NEW_DATA_PATH}, (err: any) => { });
|
||||
|
||||
storage.get('foo', (err: any, data: object) => {
|
||||
console.log(JSON.stringify(data));
|
||||
});
|
||||
|
||||
storage.get('baz', {dataPath: NEW_DATA_PATH}, (err: any, data: object) => {
|
||||
console.log(JSON.stringify(data));
|
||||
});
|
||||
|
||||
storage.getMany(['foo', 'bar'], (err: any, data: object) => {
|
||||
console.log(JSON.stringify(data));
|
||||
});
|
||||
storage.getMany(['baz'], {dataPath: NEW_DATA_PATH}, (err: any, data: object) => {
|
||||
console.log(JSON.stringify(data));
|
||||
});
|
||||
|
||||
storage.getAll((err: any, data: object) => {
|
||||
console.log(JSON.stringify(data));
|
||||
});
|
||||
|
||||
storage.getAll({dataPath: NEW_DATA_PATH}, (err: any, data: object) => {
|
||||
console.log(JSON.stringify(data));
|
||||
});
|
||||
|
||||
storage.has('foo', (err: any, hasKey: boolean) => {
|
||||
console.log("hasKey?: %s", hasKey);
|
||||
});
|
||||
|
||||
storage.has('baz', {dataPath: NEW_DATA_PATH}, (err: any, hasKey: boolean) => {
|
||||
console.log("hasKey?: %s", hasKey);
|
||||
});
|
||||
|
||||
storage.keys((err: any, keys: string[]) => {
|
||||
console.log(keys);
|
||||
});
|
||||
|
||||
storage.keys({dataPath: NEW_DATA_PATH}, (err: any, keys: string[]) => {
|
||||
console.log(keys);
|
||||
});
|
||||
|
||||
storage.remove("foo", (err: any) => {
|
||||
console.log(err);
|
||||
});
|
||||
|
||||
storage.remove("baz", {dataPath: NEW_DATA_PATH}, (err: any) => {
|
||||
console.log(err);
|
||||
});
|
||||
|
||||
storage.clear((err: any) => {
|
||||
console.log(err);
|
||||
});
|
||||
|
||||
storage.clear({dataPath: NEW_DATA_PATH}, (err: any) => {
|
||||
console.log(err);
|
||||
});
|
||||
|
||||
18
types/electron-json-storage/index.d.ts
vendored
18
types/electron-json-storage/index.d.ts
vendored
@@ -1,18 +1,28 @@
|
||||
// Type definitions for electron-json-storage 3.1
|
||||
// Type definitions for electron-json-storage 4.0
|
||||
// Project: https://github.com/electron-userland/electron-json-storage
|
||||
// Definitions by: Sam Saint-Pettersen <https://github.com/stpettersens>,
|
||||
// nrlquaker <https://github.com/nrlquaker>
|
||||
// nrlquaker <https://github.com/nrlquaker>,
|
||||
// John Woodruff <https://github.com/jbw91>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
export const DEFAULT_DATA_PATH: string;
|
||||
export function setDataPath(directory: string): void;
|
||||
export interface DataOptions { dataPath: string; }
|
||||
export function getDefaultDataPath(): string;
|
||||
export function setDataPath(directory?: string): void;
|
||||
export function getDataPath(): string;
|
||||
export function get(key: string, callback: (error: any, data: object) => void): void;
|
||||
export function get(key: string, options: DataOptions, callback: (error: any, data: object) => void): void;
|
||||
export function getMany(keys: ReadonlyArray<string>, callback: (error: any, data: object) => void): void;
|
||||
export function getMany(keys: ReadonlyArray<string>, options: DataOptions, callback: (error: any, data: object) => void): void;
|
||||
export function getAll(callback: (error: any, data: object) => void): void;
|
||||
export function getAll(options: DataOptions, callback: (error: any, data: object) => void): void;
|
||||
export function set(key: string, json: object, callback: (error: any) => void): void;
|
||||
export function set(key: string, json: object, options: DataOptions, callback: (error: any) => void): void;
|
||||
export function has(key: string, callback: (error: any, hasKey: boolean) => void): void;
|
||||
export function has(key: string, options: DataOptions, callback: (error: any, hasKey: boolean) => void): void;
|
||||
export function keys(callback: (error: any, keys: string[]) => void): void;
|
||||
export function keys(options: DataOptions, callback: (error: any, keys: string[]) => void): void;
|
||||
export function remove(key: string, callback: (error: any) => void): void;
|
||||
export function remove(key: string, options: DataOptions, callback: (error: any) => void): void;
|
||||
export function clear(callback: (error: any) => void): void;
|
||||
export function clear(options: DataOptions, callback: (error: any) => void): void;
|
||||
|
||||
@@ -18,6 +18,7 @@ function ModuleTest(): void {
|
||||
Module.print = function(text) { alert('stdout: ' + text) };
|
||||
|
||||
var int_sqrt = Module.cwrap('int_sqrt', 'number', ['number'])
|
||||
int_sqrt = Module.cwrap('int_sqrt', null, ['number'])
|
||||
int_sqrt(12)
|
||||
int_sqrt(28)
|
||||
|
||||
@@ -27,6 +28,7 @@ function ModuleTest(): void {
|
||||
var x = Module.getValue(buf, 'i32') + 123;
|
||||
Module.HEAPU8.set(myTypedArray, buf);
|
||||
Module.ccall('my_function', 'number', ['number'], [buf]);
|
||||
Module.ccall('my_function', null, ['number'], [buf]);
|
||||
Module._free(buf);
|
||||
Module.destroy({});
|
||||
}
|
||||
|
||||
4
types/emscripten/index.d.ts
vendored
4
types/emscripten/index.d.ts
vendored
@@ -40,8 +40,8 @@ declare namespace Module {
|
||||
|
||||
var Runtime: any;
|
||||
|
||||
function ccall(ident: string, returnType: string, argTypes: string[], args: any[]): any;
|
||||
function cwrap(ident: string, returnType: string, argTypes: string[]): any;
|
||||
function ccall(ident: string, returnType: string | null, argTypes: string[], args: any[]): any;
|
||||
function cwrap(ident: string, returnType: string | null, argTypes: string[]): any;
|
||||
|
||||
function setValue(ptr: number, value: any, type: string, noSafe?: boolean): void;
|
||||
function getValue(ptr: number, type: string, noSafe?: boolean): number;
|
||||
|
||||
3
types/escape-string-regexp/index.d.ts
vendored
3
types/escape-string-regexp/index.d.ts
vendored
@@ -1,10 +1,11 @@
|
||||
// Type definitions for escape-string-regexp
|
||||
// Project: https://github.com/sindresorhus/escape-string-regexp
|
||||
// Definitions by: kruncher <https://github.com/kruncher>
|
||||
// faergeek <https://github.com/faergeek>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
|
||||
|
||||
declare function escapeStringRegexp(str: string): string;
|
||||
declare const escapeStringRegexp: (str: string) => string;
|
||||
|
||||
export = escapeStringRegexp;
|
||||
|
||||
2
types/google-cloud__datastore/index.d.ts
vendored
2
types/google-cloud__datastore/index.d.ts
vendored
@@ -223,7 +223,7 @@ declare module '@google-cloud/datastore/request' {
|
||||
|
||||
runQuery(query: Query, options: QueryOptions, callback: QueryCallback): void;
|
||||
runQuery(query: Query, callback: QueryCallback): void;
|
||||
runQuery(query: Query, options?: QueryOptions): QueryResult;
|
||||
runQuery(query: Query, options?: QueryOptions): Promise<QueryResult>;
|
||||
|
||||
runQueryStream(query: Query, options?: QueryOptions): NodeJS.ReadableStream;
|
||||
|
||||
|
||||
578
types/google-cloud__pubsub/google-cloud__pubsub-tests.ts
Normal file
578
types/google-cloud__pubsub/google-cloud__pubsub-tests.ts
Normal file
@@ -0,0 +1,578 @@
|
||||
import * as PubSub from '@google-cloud/pubsub';
|
||||
|
||||
// AUTHOR NOTES: We use the examples directly from the library documentation
|
||||
// where possible. If there is a problem with a given example (e.g. undocumented
|
||||
// feature or option), we make a note of it and provide an alternative example
|
||||
// call instead.
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// PUBSUB
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
{
|
||||
let pubsub: PubSub.PubSub;
|
||||
|
||||
// https://googlecloudplatform.github.io/google-cloud-node/#/docs/pubsub/0.14.1/pubsub?method=PubSub
|
||||
// When running on Google Cloud Platform:
|
||||
pubsub = PubSub();
|
||||
// When running elsewhere:
|
||||
pubsub = PubSub({
|
||||
projectId: 'grape-spaceship-123',
|
||||
keyFilename: '/path/to/keyfile.json',
|
||||
});
|
||||
|
||||
// https://googlecloudplatform.github.io/google-cloud-node/#/docs/pubsub/0.14.1/pubsub?method=createSubscription
|
||||
// Subscribe to a topic:
|
||||
pubsub.createSubscription('messageCenter', 'newMessages', (err, subscription, apiResponse) => { });
|
||||
// Customize the subscription:
|
||||
// NOTE: ackDeadline, as given in the example, is undocumented, so create a subscription only with the KNOWN options
|
||||
pubsub.createSubscription('messageCenter', 'newMessages', {
|
||||
retainAckedMessages: true,
|
||||
}, (err, subscription, apiResponse) => { });
|
||||
// If the callback is omitted, we'll return a Promise.
|
||||
pubsub.createSubscription('messageCenter', 'newMessages').then((data) => {
|
||||
const subscription = data[0];
|
||||
const apiResponse = data[1];
|
||||
});
|
||||
|
||||
// https://googlecloudplatform.github.io/google-cloud-node/#/docs/pubsub/0.14.1/pubsub?method=createTopic
|
||||
// Create topic with callback
|
||||
pubsub.createTopic('my-new-topic', (err, topic, apiResponse) => {
|
||||
if (!err) {
|
||||
// The topic was created successfully.
|
||||
}
|
||||
});
|
||||
// If the callback is omitted, we'll return a Promise.
|
||||
pubsub.createTopic('my-new-topic').then((data) => {
|
||||
const topic = data[0];
|
||||
const apiResponse = data[1];
|
||||
});
|
||||
|
||||
// https://googlecloudplatform.github.io/google-cloud-node/#/docs/pubsub/0.14.1/pubsub?method=getSnapshots
|
||||
// Get snapshots:
|
||||
pubsub.getSnapshots((err, snapshots) => {
|
||||
if (!err) {
|
||||
// snapshots is an array of Snapshot objects.
|
||||
}
|
||||
});
|
||||
// If the callback is omitted, we'll return a Promise.
|
||||
pubsub.getSnapshots().then((data) => {
|
||||
const snapshots = data[0];
|
||||
});
|
||||
|
||||
// https://googlecloudplatform.github.io/google-cloud-node/#/docs/pubsub/0.14.1/pubsub?method=getSnapshotsStream
|
||||
// Get snapshots stream
|
||||
pubsub.getSnapshotsStream()
|
||||
.on('error', console.error)
|
||||
.on('data', (snapshot) => {
|
||||
// snapshot is a Snapshot object.
|
||||
})
|
||||
.on('end', () => {
|
||||
// All snapshots retrieved.
|
||||
});
|
||||
// If you anticipate many results, you can end a stream early to prevent unnecessary processing and API requests.
|
||||
// NOTE: this had to be modified to work around the 'this' keyword as used in the example
|
||||
{
|
||||
const stream = pubsub.getSnapshotsStream();
|
||||
stream.on('data', (snapshot) => {
|
||||
stream.end();
|
||||
});
|
||||
}
|
||||
|
||||
// https://googlecloudplatform.github.io/google-cloud-node/#/docs/pubsub/0.14.1/pubsub?method=getSubscriptions
|
||||
// Get subscriptions:
|
||||
pubsub.getSubscriptions((err, subscriptions) => {
|
||||
if (!err) {
|
||||
// subscriptions is an array of Subscription objects.
|
||||
}
|
||||
});
|
||||
// If the callback is omitted, we'll return a Promise.
|
||||
pubsub.getSubscriptions().then((data) => {
|
||||
const subscriptions = data[0];
|
||||
});
|
||||
|
||||
// https://googlecloudplatform.github.io/google-cloud-node/#/docs/pubsub/0.14.1/pubsub?method=getSubscriptionsStream
|
||||
// Get subscriptions stream
|
||||
pubsub.getSubscriptionsStream()
|
||||
.on('error', console.error)
|
||||
.on('data', (subscription) => {
|
||||
// subscription is a Subscription object.
|
||||
})
|
||||
.on('end', () => {
|
||||
// All subscriptions retrieved.
|
||||
});
|
||||
// If you anticipate many results, you can end a stream early to prevent unnecessary processing and API requests.
|
||||
// Note: this had to be modified to work around the 'this' keyword as used in the example.
|
||||
{
|
||||
const stream = pubsub.getSubscriptionsStream();
|
||||
stream.on('data', (subscription) => {
|
||||
stream.end();
|
||||
});
|
||||
}
|
||||
|
||||
// https://googlecloudplatform.github.io/google-cloud-node/#/docs/pubsub/0.14.1/pubsub?method=getTopics
|
||||
// Get topics:
|
||||
pubsub.getTopics((err, topics) => {
|
||||
if (!err) {
|
||||
// topics is an array of Topic objects.
|
||||
}
|
||||
});
|
||||
// Customize the query:
|
||||
pubsub.getTopics({
|
||||
pageSize: 3
|
||||
}, (err, topics) => { });
|
||||
// If the callback is omitted, we'll return a Promise.
|
||||
pubsub.getTopics().then((data) => {
|
||||
const topics = data[0];
|
||||
});
|
||||
|
||||
// https://googlecloudplatform.github.io/google-cloud-node/#/docs/pubsub/0.14.1/pubsub?method=getTopicsStream
|
||||
// Get topics stream:
|
||||
pubsub.getTopicsStream()
|
||||
.on('error', console.error)
|
||||
.on('data', (topic) => {
|
||||
// topic is a Topic object.
|
||||
})
|
||||
.on('end', () => {
|
||||
// All topics retrieved.
|
||||
});
|
||||
// If you anticipate many results, you can end a stream early to prevent unnecessary processing and API requests.
|
||||
// Note: this had to be modified to work around the 'this' keyword as used in the example.
|
||||
{
|
||||
const stream = pubsub.getTopicsStream();
|
||||
stream.on('data', (topic) => {
|
||||
stream.end();
|
||||
});
|
||||
}
|
||||
|
||||
// https://googlecloudplatform.github.io/google-cloud-node/#/docs/pubsub/0.14.1/pubsub?method=snapshot
|
||||
// Snapshot:
|
||||
{
|
||||
const snapshot = pubsub.snapshot('my-snapshot');
|
||||
}
|
||||
|
||||
// https://googlecloudplatform.github.io/google-cloud-node/#/docs/pubsub/0.14.1/pubsub?method=subscription
|
||||
// Subscription:
|
||||
{
|
||||
const subscription = pubsub.subscription('my-subscription');
|
||||
|
||||
// Register a listener for `message` events.
|
||||
subscription.on('message', (message) => {
|
||||
// Called every time a message is received.
|
||||
// message.id = ID of the message.
|
||||
// message.ackId = ID used to acknowledge the message receival.
|
||||
// message.data = Contents of the message.
|
||||
// message.attributes = Attributes of the message.
|
||||
// message.publishTime = Timestamp when Pub/Sub received the message.
|
||||
});
|
||||
}
|
||||
|
||||
// https://googlecloudplatform.github.io/google-cloud-node/#/docs/pubsub/0.14.1/pubsub?method=topic
|
||||
// Topic:
|
||||
{
|
||||
const topic = pubsub.topic('my-topic');
|
||||
}
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// PUBLISHER
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
{
|
||||
const pubsub = PubSub();
|
||||
const topic = pubsub.topic('my-topic');
|
||||
const publisher = topic.publisher();
|
||||
|
||||
// https://googlecloudplatform.github.io/google-cloud-node/#/docs/pubsub/0.14.1/pubsub/publisher?method=publish
|
||||
// Publish:
|
||||
publisher.publish(new Buffer('Hello, world!'), (err, messageId) => {
|
||||
if (err) {
|
||||
// Error handling omitted.
|
||||
}
|
||||
});
|
||||
// Optionally you can provide an object containing attributes for the message.
|
||||
publisher.publish(new Buffer('Hello, world!'), { key: 'value' }, (err, messageId) => {
|
||||
if (err) {
|
||||
// Error handling omitted.
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// SNAPSHOT
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
{
|
||||
const pubsub = PubSub();
|
||||
const subscription = pubsub.subscription('my-subscription');
|
||||
|
||||
// There are two type of snapshots; the ones obtained from subscription.createSnapshot() have more functionality
|
||||
const snapshot = pubsub.snapshot('my-snapshot');
|
||||
const snapshotFromSubscription = subscription.snapshot('my-snapshot');
|
||||
|
||||
// https://googlecloudplatform.github.io/google-cloud-node/#/docs/pubsub/0.14.1/pubsub/snapshot?method=create
|
||||
// Note: Only available to snapshots created via methods of Subscription
|
||||
// Create snapshot
|
||||
snapshotFromSubscription.create('my-snapshot', (err, snapshot, apiResponse) => {
|
||||
if (!err) {
|
||||
// The snapshot was created successfully.
|
||||
}
|
||||
});
|
||||
// If the callback is omitted, we'll return a Promise.
|
||||
snapshotFromSubscription.create('my-snapshot').then((data) => {
|
||||
const snapshot = data[0];
|
||||
const apiResponse = data[1];
|
||||
});
|
||||
|
||||
// https://googlecloudplatform.github.io/google-cloud-node/#/docs/pubsub/0.14.1/pubsub/snapshot?method=delete
|
||||
// Delete the snapshot
|
||||
snapshot.delete((err, apiResponse) => { });
|
||||
// If the callback is omitted, we'll return a Promise.
|
||||
snapshot.delete().then((data) => {
|
||||
const apiResponse = data[0];
|
||||
});
|
||||
|
||||
// https://googlecloudplatform.github.io/google-cloud-node/#/docs/pubsub/0.14.1/pubsub/snapshot?method=seek
|
||||
// Note: Only available to snapshots created via methods of Subscription
|
||||
// Seek:
|
||||
snapshotFromSubscription.seek((err, apiResponse) => { });
|
||||
// If the callback is omitted, we'll return a Promise.
|
||||
snapshotFromSubscription.seek().then((data) => {
|
||||
const apiResponse = data[0];
|
||||
});
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// SUBSCRIPTION
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
{
|
||||
const pubsub = PubSub();
|
||||
const topic = pubsub.topic('my-topic');
|
||||
const subscription = topic.subscription('my-subscription');
|
||||
|
||||
// https://googlecloudplatform.github.io/google-cloud-node/#/docs/pubsub/0.14.1/pubsub/subscription?method=close
|
||||
// Close:
|
||||
subscription.close((err) => {
|
||||
if (err) {
|
||||
// Error handling omitted.
|
||||
}
|
||||
});
|
||||
// If the callback is omitted, we'll return a Promise.
|
||||
subscription.close().then(() => { });
|
||||
|
||||
// https://googlecloudplatform.github.io/google-cloud-node/#/docs/pubsub/0.14.1/pubsub/subscription?method=createSnapshot
|
||||
// Create snapshot:
|
||||
subscription.createSnapshot('my-snapshot', (err, snapshot, apiResponse) => {
|
||||
if (!err) {
|
||||
// The snapshot was created successfully.
|
||||
}
|
||||
});
|
||||
// If the callback is omitted, we'll return a Promise.
|
||||
subscription.createSnapshot('my-snapshot').then((data) => {
|
||||
const snapshot = data[0];
|
||||
const apiResponse = data[1];
|
||||
});
|
||||
|
||||
// https://googlecloudplatform.github.io/google-cloud-node/#/docs/pubsub/0.14.1/pubsub/subscription?method=delete
|
||||
// Delete:
|
||||
subscription.delete((err, apiResponse) => { });
|
||||
// If the callback is omitted, we'll return a Promise.
|
||||
subscription.delete().then((data) => {
|
||||
const apiResponse = data[0];
|
||||
});
|
||||
|
||||
// https://googlecloudplatform.github.io/google-cloud-node/#/docs/pubsub/0.14.1/pubsub/subscription?method=exists
|
||||
// Exists:
|
||||
subscription.exists((err, exists) => { });
|
||||
// If the callback is omitted, we'll return a Promise.
|
||||
subscription.exists().then((data) => {
|
||||
const exists = data[0];
|
||||
});
|
||||
|
||||
// https://googlecloudplatform.github.io/google-cloud-node/#/docs/pubsub/0.14.1/pubsub/subscription?method=get
|
||||
// Get:
|
||||
subscription.get((err, subscription, apiResponse) => {
|
||||
// The `subscription` data has been populated.
|
||||
});
|
||||
// If the callback is omitted, we'll return a Promise.
|
||||
subscription.get().then((data) => {
|
||||
const subscription = data[0];
|
||||
const apiResponse = data[1];
|
||||
});
|
||||
|
||||
// https://googlecloudplatform.github.io/google-cloud-node/#/docs/pubsub/0.14.1/pubsub/subscription?method=getMetadata
|
||||
// Get metadata:
|
||||
subscription.getMetadata((err, apiResponse) => {
|
||||
if (err) {
|
||||
// Error handling omitted.
|
||||
}
|
||||
});
|
||||
// If the callback is omitted, we'll return a Promise.
|
||||
subscription.getMetadata().then((data) => {
|
||||
const apiResponse = data[0];
|
||||
});
|
||||
|
||||
// https://googlecloudplatform.github.io/google-cloud-node/#/docs/pubsub/0.14.1/pubsub/subscription?method=modifyPushConfig
|
||||
// Modify push config:
|
||||
// Note: Had to modify the code to force typings
|
||||
{
|
||||
const pushConfig: PubSub.Subscription.PushConfig = {
|
||||
pushEndpoint: 'https://mydomain.com/push',
|
||||
attributes: {
|
||||
'x-goog-version': 'v1',
|
||||
}
|
||||
};
|
||||
subscription.modifyPushConfig(pushConfig, (err, apiResponse) => {
|
||||
if (err) {
|
||||
// Error handling omitted.
|
||||
}
|
||||
});
|
||||
// If the callback is omitted, we'll return a Promise.
|
||||
subscription.modifyPushConfig(pushConfig).then((data) => {
|
||||
const apiResponse = data[0];
|
||||
});
|
||||
}
|
||||
|
||||
// https://googlecloudplatform.github.io/google-cloud-node/#/docs/pubsub/0.14.1/pubsub/subscription?method=seek
|
||||
// Seek:
|
||||
{
|
||||
const callback: PubSub.Subscription.SeekCallback = (err, resp) => {
|
||||
if (!err) {
|
||||
// Seek was successful.
|
||||
}
|
||||
};
|
||||
subscription.seek('my-snapshot', callback);
|
||||
// Alternatively, to specify a certain point in time, you can provide a Date object.
|
||||
subscription.seek(new Date('October 21 2015'), callback);
|
||||
}
|
||||
|
||||
// https://googlecloudplatform.github.io/google-cloud-node/#/docs/pubsub/0.14.1/pubsub/subscription?method=setMetadata
|
||||
{
|
||||
const metadata = {
|
||||
key: 'value'
|
||||
};
|
||||
|
||||
// Set metadata
|
||||
subscription.setMetadata(metadata, (err, apiResponse) => {
|
||||
if (err) {
|
||||
// Error handling omitted.
|
||||
}
|
||||
});
|
||||
// If the callback is omitted, we'll return a Promise.
|
||||
subscription.setMetadata(metadata).then((data) => {
|
||||
const apiResponse = data[0];
|
||||
});
|
||||
}
|
||||
|
||||
// https://googlecloudplatform.github.io/google-cloud-node/#/docs/pubsub/0.14.1/pubsub/subscription?method=snapshot
|
||||
// Snapshot:
|
||||
subscription.snapshot('my-snapshot');
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// TOPIC
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
{
|
||||
const pubsub = PubSub();
|
||||
const topic = pubsub.topic('my-topic');
|
||||
|
||||
// https://googlecloudplatform.github.io/google-cloud-node/#/docs/pubsub/0.14.1/pubsub/topic?method=create
|
||||
// Create:
|
||||
topic.create((err, topic, apiResponse) => {
|
||||
if (!err) {
|
||||
// The topic was created successfully.
|
||||
}
|
||||
});
|
||||
// If the callback is omitted, we'll return a Promise.
|
||||
topic.create().then((data) => {
|
||||
const topic = data[0];
|
||||
const apiResponse = data[1];
|
||||
});
|
||||
|
||||
// https://googlecloudplatform.github.io/google-cloud-node/#/docs/pubsub/0.14.1/pubsub/topic?method=createSubscription
|
||||
{
|
||||
const callback: PubSub.Topic.CreateSubscriptionCallback = (err, subscription, apiResponse) => { };
|
||||
|
||||
// Without specifying any options.
|
||||
topic.createSubscription('newMessages', callback);
|
||||
|
||||
// With options.
|
||||
// Note: ackDeadline not documented, so we use a different option
|
||||
topic.createSubscription('newMessages', {
|
||||
// ackDeadline: 90000 // 90 seconds
|
||||
retainAckedMessages: true,
|
||||
}, callback);
|
||||
|
||||
// If the callback is omitted, we'll return a Promise.
|
||||
topic.createSubscription('newMessages').then((data) => {
|
||||
const subscription = data[0];
|
||||
const apiResponse = data[1];
|
||||
});
|
||||
}
|
||||
|
||||
// https://googlecloudplatform.github.io/google-cloud-node/#/docs/pubsub/0.14.1/pubsub/topic?method=delete
|
||||
// Delete:
|
||||
topic.delete((err, apiResponse) => { });
|
||||
// If the callback is omitted, we'll return a Promise.
|
||||
topic.delete().then((data) => {
|
||||
const apiResponse = data[0];
|
||||
});
|
||||
|
||||
// https://googlecloudplatform.github.io/google-cloud-node/#/docs/pubsub/0.14.1/pubsub/topic?method=exists
|
||||
// Exists:
|
||||
topic.exists((err, exists) => { });
|
||||
// If the callback is omitted, we'll return a Promise.
|
||||
topic.exists().then((data) => {
|
||||
const exists = data[0];
|
||||
});
|
||||
|
||||
// https://googlecloudplatform.github.io/google-cloud-node/#/docs/pubsub/0.14.1/pubsub/topic?method=get
|
||||
// Get:
|
||||
topic.get((err, topic, apiResponse) => {
|
||||
// The `topic` data has been populated.
|
||||
});
|
||||
// If the callback is omitted, we'll return a Promise.
|
||||
topic.get().then((data) => {
|
||||
const topic = data[0];
|
||||
const apiResponse = data[1];
|
||||
});
|
||||
|
||||
// https://googlecloudplatform.github.io/google-cloud-node/#/docs/pubsub/0.14.1/pubsub/topic?method=getMetadata
|
||||
// Get metadata
|
||||
topic.getMetadata((err, apiResponse) => { });
|
||||
// If the callback is omitted, we'll return a Promise.
|
||||
topic.getMetadata().then((data) => {
|
||||
const apiResponse = data[0];
|
||||
});
|
||||
|
||||
// https://googlecloudplatform.github.io/google-cloud-node/#/docs/pubsub/0.14.1/pubsub/topic?method=getSubscriptions
|
||||
// Get subscriptions:
|
||||
// Note: Modified so that the callback is a constant
|
||||
{
|
||||
const callback: PubSub.Topic.GetSubscriptionsCallback = (err, subscriptions) => {
|
||||
// subscriptions is an array of `Subscription` objects.
|
||||
};
|
||||
|
||||
topic.getSubscriptions(callback);
|
||||
|
||||
// Customize the query.
|
||||
topic.getSubscriptions({
|
||||
pageSize: 3
|
||||
}, callback);
|
||||
|
||||
// If the callback is omitted, we'll return a Promise.
|
||||
topic.getSubscriptions().then((data) => {
|
||||
const subscriptions = data[0];
|
||||
});
|
||||
}
|
||||
|
||||
// https://googlecloudplatform.github.io/google-cloud-node/#/docs/pubsub/0.14.1/pubsub/topic?method=getSubscriptionsStream
|
||||
// Get subscriptions stream:
|
||||
topic.getSubscriptionsStream()
|
||||
.on('error', console.error)
|
||||
.on('data', (subscription) => {
|
||||
// subscription is a Subscription object.
|
||||
})
|
||||
.on('end', () => {
|
||||
// All subscriptions retrieved.
|
||||
});
|
||||
// If you anticipate many results, you can end a stream early to prevent unnecessary processing and API requests.
|
||||
{
|
||||
const stream = topic.getSubscriptionsStream();
|
||||
stream.on('data', (subscription) => {
|
||||
stream.end();
|
||||
});
|
||||
}
|
||||
|
||||
// https://googlecloudplatform.github.io/google-cloud-node/#/docs/pubsub/0.14.1/pubsub/topic?method=publisher
|
||||
topic.publisher().publish(new Buffer('Hello, world!'), (err, messageId) => {
|
||||
if (err) {
|
||||
// Error handling omitted.
|
||||
}
|
||||
});
|
||||
|
||||
// https://googlecloudplatform.github.io/google-cloud-node/#/docs/pubsub/0.14.1/pubsub/topic?method=subscription
|
||||
// Register a listener for `message` events.
|
||||
topic.subscription('my-subscription').on('message', (message) => {
|
||||
// Called every time a message is received.
|
||||
// message.id = ID of the message.
|
||||
// message.ackId = ID used to acknowledge the message receival.
|
||||
// message.data = Contents of the message.
|
||||
// message.attributes = Attributes of the message.
|
||||
// message.publishTime = Timestamp when Pub/Sub received the message.
|
||||
});
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// IAM
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
{
|
||||
const pubsub = PubSub();
|
||||
const topic = pubsub.topic('my-topic');
|
||||
const subscription = topic.subscription('my-subscription');
|
||||
|
||||
// https://googlecloudplatform.github.io/google-cloud-node/#/docs/pubsub/0.14.1/pubsub/subscription?method=iam.getPolicy
|
||||
// https://googlecloudplatform.github.io/google-cloud-node/#/docs/pubsub/0.14.1/pubsub/topic?method=iam.getPolicy
|
||||
// Get policy:
|
||||
topic.iam.getPolicy((err, policy, apiResponse) => { });
|
||||
subscription.iam.getPolicy((err, policy, apiResponse) => { });
|
||||
// If the callback is omitted, we'll return a Promise.
|
||||
topic.iam.getPolicy().then((data) => {
|
||||
const policy = data[0];
|
||||
const apiResponse = data[1];
|
||||
});
|
||||
|
||||
// https://googlecloudplatform.github.io/google-cloud-node/#/docs/pubsub/0.14.1/pubsub/subscription?method=iam.setPolicy
|
||||
// https://googlecloudplatform.github.io/google-cloud-node/#/docs/pubsub/0.14.1/pubsub/topic?method=iam.setPolicy
|
||||
{
|
||||
const myPolicy = {
|
||||
bindings: [
|
||||
{
|
||||
role: 'roles/pubsub.subscriber',
|
||||
members: ['serviceAccount:myotherproject@appspot.gserviceaccount.com']
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
// Set policy:
|
||||
topic.iam.setPolicy(myPolicy, (err, policy, apiResponse) => { });
|
||||
subscription.iam.setPolicy(myPolicy, (err, policy, apiResponse) => { });
|
||||
|
||||
// If the callback is omitted, we'll return a Promise.
|
||||
topic.iam.setPolicy(myPolicy).then((data) => {
|
||||
const policy = data[0];
|
||||
const apiResponse = data[1];
|
||||
});
|
||||
}
|
||||
|
||||
// https://googlecloudplatform.github.io/google-cloud-node/#/docs/pubsub/0.14.1/pubsub/subscription?method=iam.testPermissions
|
||||
// https://googlecloudplatform.github.io/google-cloud-node/#/docs/pubsub/0.14.1/pubsub/topic?method=iam.testPermissions
|
||||
{
|
||||
const test = 'pubsub.topics.update';
|
||||
|
||||
// Test permission
|
||||
topic.iam.testPermissions(test, (err, permissions, apiResponse) => {
|
||||
console.log(permissions);
|
||||
// {
|
||||
// "pubsub.topics.update": true
|
||||
// }
|
||||
});
|
||||
|
||||
// Test several permissions at once.
|
||||
const tests = [
|
||||
'pubsub.subscriptions.consume',
|
||||
'pubsub.subscriptions.update'
|
||||
];
|
||||
|
||||
subscription.iam.testPermissions(tests, (err, permissions) => {
|
||||
console.log(permissions);
|
||||
// {
|
||||
// "pubsub.subscriptions.consume": true,
|
||||
// "pubsub.subscriptions.update": false
|
||||
// }
|
||||
});
|
||||
|
||||
// If the callback is omitted, we'll return a Promise.
|
||||
topic.iam.testPermissions(test).then((data) => {
|
||||
const permissions = data[0];
|
||||
const apiResponse = data[1];
|
||||
});
|
||||
}
|
||||
}
|
||||
344
types/google-cloud__pubsub/index.d.ts
vendored
Normal file
344
types/google-cloud__pubsub/index.d.ts
vendored
Normal file
@@ -0,0 +1,344 @@
|
||||
// Type definitions for @google-cloud/pubsub 0.14
|
||||
// Project: https://github.com/GoogleCloudPlatform/google-cloud-node/tree/master/packages/pubsub
|
||||
// Definitions by: Paul Huynh <https://github.com/pheromonez>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
/// <reference types="node"/>
|
||||
import { EventEmitter } from "events";
|
||||
import { Duplex } from "stream";
|
||||
|
||||
declare namespace PubSub {
|
||||
// TODO write definitions for the for v1
|
||||
// https://googlecloudplatform.github.io/google-cloud-node/#/docs/pubsub/0.14.1/pubsub/v1
|
||||
function v1(config?: GCloudConfiguration): any;
|
||||
|
||||
interface GCloudConfiguration {
|
||||
projectId?: string;
|
||||
keyFilename?: string;
|
||||
email?: string;
|
||||
credentials?: {
|
||||
client_email?: string;
|
||||
private_key?: string
|
||||
};
|
||||
autoRetry?: boolean;
|
||||
maxRetries?: number;
|
||||
promise?: any;
|
||||
}
|
||||
|
||||
interface PubSub {
|
||||
createSubscription(topic: Topic | string, name: string, options?: PubSub.CreateSubscriptionOptions): Promise<any[]>;
|
||||
createSubscription(topic: Topic | string, name: string, callback: PubSub.CreateSubscriptionCallback): void;
|
||||
createSubscription(topic: Topic | string, name: string, options: PubSub.CreateSubscriptionOptions, callback: PubSub.CreateSubscriptionCallback): void;
|
||||
|
||||
createTopic(name: string, gaxOpts?: GAX.CallOptions): Promise<any[]>;
|
||||
createTopic(name: string, callback: PubSub.CreateTopicCallback): void;
|
||||
createTopic(name: string, gaxOpts: GAX.CallOptions, callback: PubSub.CreateTopicCallback): void;
|
||||
|
||||
getSnapshots(options?: PubSub.GetSnapshotsOptions): Promise<any[]>;
|
||||
getSnapshots(callback: PubSub.GetSnapshotsCallback): void;
|
||||
getSnapshots(options: PubSub.GetSnapshotsOptions, callback: PubSub.GetSnapshotsCallback): void;
|
||||
|
||||
getSnapshotsStream(options?: PubSub.GetSnapshotsOptions): Duplex;
|
||||
|
||||
getSubscriptions(options?: PubSub.GetSubscriptionsOptions): Promise<any[]>;
|
||||
getSubscriptions(callback: PubSub.GetSubscriptionsCallback): void;
|
||||
getSubscriptions(options: PubSub.GetSubscriptionsOptions, callback: PubSub.GetSubscriptionsCallback): void;
|
||||
|
||||
getSubscriptionsStream(options?: PubSub.GetSubscriptionsOptions): Duplex;
|
||||
|
||||
getTopics(query?: PubSub.GetTopicsQuery): Promise<any[]>;
|
||||
getTopics(callback: PubSub.GetTopicsCallback): void;
|
||||
getTopics(query: PubSub.GetTopicsQuery, callback: PubSub.GetTopicsCallback): void;
|
||||
|
||||
getTopicsStream(query?: PubSub.GetTopicsQuery): Duplex;
|
||||
|
||||
snapshot(name: string): Snapshot;
|
||||
|
||||
subscription(name: string, options?: PubSub.SubscriptionOptions): Subscription;
|
||||
|
||||
topic(name: string): Topic;
|
||||
}
|
||||
namespace PubSub {
|
||||
interface CreateSubscriptionOptions {
|
||||
flowControl?: {
|
||||
maxBytes?: number;
|
||||
maxMessages?: number;
|
||||
};
|
||||
gaxOpts?: GAX.CallOptions;
|
||||
messageRetentionDuration?: number | Date;
|
||||
pushEndpoint?: string;
|
||||
retainAckedMessages?: boolean;
|
||||
}
|
||||
type CreateSubscriptionCallback = (err: Error | null, subscription: Subscription, apiResponse: object) => void;
|
||||
|
||||
type CreateTopicCallback = (err: Error | null, topic: Topic, apiResponse: object) => void;
|
||||
|
||||
interface GetSnapshotsOptions {
|
||||
autoPaginate?: boolean;
|
||||
gaxOpts?: GAX.CallOptions;
|
||||
pageSize?: number;
|
||||
pageToken?: string;
|
||||
}
|
||||
type GetSnapshotsCallback = (err: Error | null, snapshots: Snapshot[]) => void;
|
||||
|
||||
interface GetSubscriptionsOptions {
|
||||
autoPaginate?: boolean;
|
||||
gaxOpts?: GAX.CallOptions;
|
||||
pageSize?: number;
|
||||
pageToken?: string;
|
||||
topic?: Topic | string;
|
||||
}
|
||||
type GetSubscriptionsCallback = (err: Error | null, subscriptions: Subscription[], apiResponse: object) => void;
|
||||
|
||||
interface GetTopicsQuery {
|
||||
autoPaginate?: boolean;
|
||||
gaxOpts?: GAX.CallOptions;
|
||||
pageSize?: number;
|
||||
pageToken?: string;
|
||||
}
|
||||
type GetTopicsCallback = (err: Error | null, topics: Topic[], apiResponse: object) => void;
|
||||
|
||||
interface SubscriptionOptions {
|
||||
flowControl?: {
|
||||
maxBytes?: number;
|
||||
maxMessages?: number;
|
||||
};
|
||||
maxConnections?: number;
|
||||
}
|
||||
}
|
||||
|
||||
interface Publisher {
|
||||
publish(data: Buffer, callback: Publisher.PublishCallback): void;
|
||||
publish(data: Buffer, attributes: object, callback: Publisher.PublishCallback): void;
|
||||
publish(data: Buffer, attributes?: object): Promise<any[]>;
|
||||
}
|
||||
namespace Publisher {
|
||||
type PublishCallback = (error: Error | null, messageId: string) => void;
|
||||
}
|
||||
|
||||
interface Snapshot {
|
||||
delete(): Promise<any[]>;
|
||||
delete(callback: Snapshot.DeleteCallback): void;
|
||||
}
|
||||
interface SnapshotFromSubscription extends Snapshot {
|
||||
create(name: string): Promise<any[]>;
|
||||
create(name: string, callback: Snapshot.CreateCallback): void;
|
||||
|
||||
seek(): Promise<any[]>;
|
||||
seek(callback: Snapshot.SeekCallback): void;
|
||||
}
|
||||
namespace Snapshot {
|
||||
type DeleteCallback = (err: Error | null, apiResponse: object) => void;
|
||||
|
||||
type CreateCallback = (err: Error | null, snapshot: Snapshot, apiResponse: object) => void;
|
||||
|
||||
type SeekCallback = (err: Error | null, apiResponse: object) => void;
|
||||
}
|
||||
|
||||
interface Subscription extends EventEmitter {
|
||||
close(): Promise<void>;
|
||||
close(callback: Subscription.CloseCallback): void;
|
||||
|
||||
createSnapshot(name: string, gaxOpts?: GAX.CallOptions): Promise<any[]>;
|
||||
createSnapshot(name: string, callback: Subscription.CreateSnapshotCallback): void;
|
||||
createSnapshot(name: string, gaxOpts: GAX.CallOptions, callback: Subscription.CreateSnapshotCallback): void;
|
||||
|
||||
delete(gaxOpts?: GAX.CallOptions): Promise<any[]>;
|
||||
delete(callback: Subscription.DeleteCallback): void;
|
||||
delete(gaxOpts: GAX.CallOptions, callback: Subscription.DeleteCallback): void;
|
||||
|
||||
exists(): Promise<any[]>;
|
||||
exists(callback: Subscription.ExistsCallback): void;
|
||||
|
||||
get(gaxOpts?: GAX.CallOptions): Promise<any[]>; // TODO: only expose autoCreate
|
||||
// NOTE: The following are not documented, but are possible signatures base on the source code
|
||||
get(callback: Subscription.GetCallback): void;
|
||||
get(gaxOpts: GAX.CallOptions, callback: Subscription.GetCallback): void;
|
||||
|
||||
getMetadata(gaxOpts?: GAX.CallOptions): Promise<any[]>;
|
||||
getMetadata(callback: Subscription.GetMetadataCallback): void;
|
||||
getMetadata(gaxOpts: GAX.CallOptions, callback: Subscription.GetMetadataCallback): void;
|
||||
|
||||
iam: IAM;
|
||||
|
||||
modifyPushConfig(config: Subscription.PushConfig, gaxOpts?: GAX.CallOptions): Promise<any[]>;
|
||||
modifyPushConfig(config: Subscription.PushConfig, callback: Subscription.ModifyPushConfigCallback): void;
|
||||
modifyPushConfig(config: Subscription.PushConfig, gaxOpts: GAX.CallOptions, callback: Subscription.ModifyPushConfigCallback): void;
|
||||
|
||||
seek(snapshot: string | Date, callback: Subscription.SeekCallback): void;
|
||||
seek(snapshot: string | Date, gaxOpts: GAX.CallOptions, callback: Subscription.SeekCallback): void;
|
||||
|
||||
setMetadata(metadata: object, gaxOpts?: GAX.CallOptions): Promise<any[]>;
|
||||
setMetadata(metadata: object, callback: Subscription.SetMetadataCallback): void;
|
||||
setMetadata(metadata: object, gaxOpts: GAX.CallOptions, callback: Subscription.SetMetadataCallback): void;
|
||||
|
||||
snapshot(name: string): SnapshotFromSubscription;
|
||||
}
|
||||
namespace Subscription {
|
||||
type CloseCallback = (err: Error | null) => void;
|
||||
|
||||
type CreateSnapshotCallback = (err: Error | null, snapshot: SnapshotFromSubscription, apiResponse: object) => void;
|
||||
|
||||
type DeleteCallback = (err: Error | null, apiResponse: object) => void;
|
||||
|
||||
type ExistsCallback = (err: Error | null, exists: boolean) => void;
|
||||
|
||||
type GetCallback = (err: Error | null, subscription: Subscription, apiResponse: object) => void;
|
||||
|
||||
type GetMetadataCallback = (err: Error | null, apiResponse: object) => void;
|
||||
|
||||
interface PushConfig {
|
||||
pushEndpoint?: string;
|
||||
// https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.subscriptions#pushconfig
|
||||
attributes?: PushConfigAttributes;
|
||||
}
|
||||
interface PushConfigAttributes {
|
||||
'x-goog-version': 'v1beta' | 'v1' | 'v1beta2';
|
||||
}
|
||||
type ModifyPushConfigCallback = (err: Error | null, apiResponse: object) => void;
|
||||
|
||||
type SeekCallback = (err: Error | null, apiResponse: object) => void;
|
||||
|
||||
type SetMetadataCallback = (err: Error | null, apiResponse: object) => void;
|
||||
}
|
||||
|
||||
interface Topic {
|
||||
create(gaxOpts?: GAX.CallOptions): Promise<any[]>;
|
||||
create(callback: Topic.CreateCallback): void;
|
||||
create(gaxOpts: GAX.CallOptions, callback: Topic.CreateCallback): void;
|
||||
|
||||
createSubscription(nameOrOptions?: string | Topic.CreateSubscriptionOptions): Promise<any[]>;
|
||||
createSubscription(name: string, options: Topic.CreateSubscriptionOptions): Promise<any[]>;
|
||||
createSubscription(callback: Topic.CreateSubscriptionCallback): void;
|
||||
createSubscription(nameOrOptions: string | Topic.CreateSubscriptionOptions, callback: Topic.CreateSubscriptionCallback): void;
|
||||
createSubscription(name: string, options: Topic.CreateSubscriptionOptions, callback: Topic.CreateSubscriptionCallback): void;
|
||||
|
||||
delete(gaxOpts?: GAX.CallOptions): Promise<any[]>;
|
||||
delete(callback: Topic.DeleteCallback): void;
|
||||
delete(gaxOpts: GAX.CallOptions, callback: Topic.DeleteCallback): void;
|
||||
|
||||
exists(): Promise<any[]>;
|
||||
exists(callback: Topic.ExistsCallback): void;
|
||||
|
||||
// NOTE: The documentation in the link is incomplete; the function takes a callback
|
||||
// as second argument (in the source):
|
||||
// https://googlecloudplatform.github.io/google-cloud-node/#/docs/pubsub/0.14.1/pubsub/topic?method=get
|
||||
get(gaxOpts?: GAX.CallOptions): Promise<any[]>;
|
||||
get(callback: Topic.GetCallback): void;
|
||||
get(gaxOpts: GAX.CallOptions, callback: Topic.GetCallback): void;
|
||||
|
||||
getMetadata(gaxOpts?: GAX.CallOptions): Promise<any[]>;
|
||||
getMetadata(callback: Topic.GetMetadataCallback): void;
|
||||
getMetadata(gaxOpts: GAX.CallOptions, callback: Topic.GetMetadataCallback): void;
|
||||
|
||||
getSubscriptions(options?: Topic.GetSubscriptionsOptions): Promise<any[]>;
|
||||
getSubscriptions(callback: Topic.GetSubscriptionsCallback): void;
|
||||
getSubscriptions(options: Topic.GetSubscriptionsOptions, callback: Topic.GetSubscriptionsCallback): void;
|
||||
|
||||
// Note: The documention lists the parameter as 'query', when it probably should be 'options'.
|
||||
getSubscriptionsStream(options?: Topic.GetSubscriptionsOptions): Duplex;
|
||||
|
||||
iam: IAM;
|
||||
|
||||
publisher(options?: Topic.PublisherOptions): Publisher;
|
||||
|
||||
subscription(name: string, options?: Topic.SubscriptionOptions): Subscription;
|
||||
}
|
||||
namespace Topic {
|
||||
type CreateCallback = PubSub.CreateTopicCallback;
|
||||
|
||||
type CreateSubscriptionOptions = PubSub.CreateSubscriptionOptions;
|
||||
type CreateSubscriptionCallback = PubSub.CreateSubscriptionCallback;
|
||||
|
||||
// Note: This is not fully documented in the link; browse the source code to find the callback parameters
|
||||
// https://googlecloudplatform.github.io/google-cloud-node/#/docs/pubsub/0.14.1/pubsub/topic?method=delete
|
||||
type DeleteCallback = (err: Error | null, apiResponse: object) => void;
|
||||
|
||||
type ExistsCallback = (err: Error | null, exists: boolean) => void;
|
||||
|
||||
// Note: This is not fully documented in the link; browse the source code to find the callback parameters
|
||||
// https://googlecloudplatform.github.io/google-cloud-node/#/docs/pubsub/0.14.1/pubsub/topic?method=get
|
||||
type GetCallback = (err: Error | null, topic: Topic, apiResponse: object) => void;
|
||||
|
||||
type GetMetadataCallback = (err: Error | null, apiResponse: object) => void;
|
||||
|
||||
// Options are SLIGHTLY different to PubSub.getSubscriptions(...), so we can't just reuse it
|
||||
interface GetSubscriptionsOptions {
|
||||
autoPaginate?: boolean;
|
||||
gaxOpts?: GAX.CallOptions;
|
||||
pageSize?: number;
|
||||
pageToken?: string;
|
||||
}
|
||||
// Callback signature also slightly different to PubSub.getSubscriptions(callback), so we can't just reuse it
|
||||
type GetSubscriptionsCallback = (err: Error | null, subscriptions: Subscription[]) => void;
|
||||
|
||||
interface PublisherOptions {
|
||||
batching?: {
|
||||
maxBytes?: number;
|
||||
maxMessages?: number;
|
||||
maxMilliseconds?: number;
|
||||
};
|
||||
}
|
||||
|
||||
type SubscriptionOptions = PubSub.SubscriptionOptions;
|
||||
}
|
||||
|
||||
// Allow this interface to start with 'I', since it's an acronym!
|
||||
// tslint:disable-next-line interface-name
|
||||
interface IAM {
|
||||
getPolicy(): Promise<any[]>;
|
||||
getPolicy(callback: IAM.GetPolicyCallback): void;
|
||||
|
||||
setPolicy(policy: IAM.Policy): Promise<any[]>;
|
||||
setPolicy(policy: IAM.Policy, callback: IAM.SetPolicyCallback): void;
|
||||
|
||||
testPermissions(permissions: string | string[]): Promise<any[]>;
|
||||
testPermissions(permissions: string | string[], callback: IAM.TestPermissionsCallback): void;
|
||||
}
|
||||
namespace IAM {
|
||||
type GetPolicyCallback = (err: Error | null, policy: Policy, apiResponse: object) => void;
|
||||
|
||||
type SetPolicyCallback = (err: Error | null, policy: Policy, apiResponse: object) => void;
|
||||
|
||||
type TestPermissionsCallback = (err: Error | null, permissions: string | string[], apiResponse: object) => void;
|
||||
|
||||
interface Policy {
|
||||
bindings?: any[];
|
||||
rules?: object[];
|
||||
etag?: string;
|
||||
}
|
||||
}
|
||||
|
||||
namespace GAX {
|
||||
/** https://googleapis.github.io/gax-nodejs/global.html#CallOptions */
|
||||
interface CallOptions {
|
||||
timeout?: number;
|
||||
retry?: RetryOptions;
|
||||
autoPaginate?: boolean;
|
||||
pageToken?: object;
|
||||
isBundling?: boolean;
|
||||
longrunning?: BackoffSettings;
|
||||
promise?: PromiseConstructor; // FIXME Unsure if this is the correct type; remove this comment if it is
|
||||
}
|
||||
|
||||
/** https://googleapis.github.io/gax-nodejs/global.html#RetryOptions */
|
||||
interface RetryOptions {
|
||||
retryCodes: string[];
|
||||
backoffSettings: BackoffSettings;
|
||||
}
|
||||
|
||||
/** https://googleapis.github.io/gax-nodejs/global.html#BackoffSettings */
|
||||
interface BackoffSettings {
|
||||
initialRetryDelayMillis: number;
|
||||
retryDelayMultiplier: number;
|
||||
maxRetryDelayMillis: number;
|
||||
initialRpcTimeoutMillis: number;
|
||||
maxRpcTimeoutMillis: number;
|
||||
totalTimeoutMillis: number;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
declare function PubSub(config?: PubSub.GCloudConfiguration): PubSub.PubSub;
|
||||
export = PubSub;
|
||||
28
types/google-cloud__pubsub/tsconfig.json
Normal file
28
types/google-cloud__pubsub/tsconfig.json
Normal file
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"paths": {
|
||||
"@google-cloud/pubsub": [
|
||||
"google-cloud__pubsub"
|
||||
]
|
||||
},
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"google-cloud__pubsub-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/google-cloud__pubsub/tslint.json
Normal file
1
types/google-cloud__pubsub/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
@@ -41,14 +41,39 @@ describe('UniversalAnalytics', () => {
|
||||
});
|
||||
it('should excercise Tracker APIs', () => {
|
||||
const tracker: UniversalAnalytics.Tracker = ga.create('UA-65432-1', 'auto');
|
||||
const aString: string = tracker.get<string>('aString');
|
||||
const aNumber: number = tracker.get<number>('aNumber');
|
||||
const anObject: {} = tracker.get<{}>('anObject');
|
||||
|
||||
tracker.get('fieldName');
|
||||
|
||||
tracker.set('aString', 'aString');
|
||||
tracker.set('aNumber', 1);
|
||||
tracker.set('anObject', {});
|
||||
tracker.set({
|
||||
several: 'values',
|
||||
at: 'once'
|
||||
});
|
||||
|
||||
tracker.send('pageview');
|
||||
tracker.send('pageview', '/some-path');
|
||||
tracker.send('pageview', {some: 'details'});
|
||||
tracker.set('aString', aString);
|
||||
tracker.set('aNumber', aNumber);
|
||||
tracker.set('anObject', anObject);
|
||||
});
|
||||
|
||||
it('should exercise Model APIs', () => {
|
||||
const tracker: UniversalAnalytics.Tracker = ga.create('UA-65432-1', 'auto');
|
||||
|
||||
tracker.set('sendHitTask', (gaHitModel: UniversalAnalytics.Model) => {
|
||||
gaHitModel.get('hitPayload');
|
||||
|
||||
gaHitModel.set('hitCallback', () => console.log('hit sent'), true);
|
||||
gaHitModel.set('hitCallback', () => console.log('hit sent'));
|
||||
gaHitModel.set({
|
||||
hitPayload: 'a=1&b=2',
|
||||
otherField: 3
|
||||
});
|
||||
gaHitModel.set({
|
||||
hitPayload: 'a=1&b=2',
|
||||
otherField: 3
|
||||
}, null, false);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
19
types/google.analytics/index.d.ts
vendored
19
types/google.analytics/index.d.ts
vendored
@@ -1,6 +1,6 @@
|
||||
// Type definitions for Google Analytics (Classic and Universal)
|
||||
// Project: https://developers.google.com/analytics/devguides/collection/gajs/, https://developers.google.com/analytics/devguides/collection/analyticsjs/method-reference
|
||||
// Definitions by: Ronnie Haakon Hegelund <http://ronniehegelund.blogspot.dk>, Pat Kujawa <http://patkujawa.com>
|
||||
// Definitions by: Ronnie Haakon Hegelund <http://ronniehegelund.blogspot.dk>, Pat Kujawa <http://patkujawa.com>, Tyler Murphy <https://github.com/tyler-murphy>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare class Tracker {
|
||||
@@ -620,12 +620,17 @@ declare namespace UniversalAnalytics {
|
||||
}
|
||||
|
||||
interface Tracker {
|
||||
get<T>(fieldName: string): T;
|
||||
send(hitType: string, opt_fieldObject?: {}): void;
|
||||
set(fieldName: string, value: string): void;
|
||||
set(fieldName: string, value: {}): void;
|
||||
set(fieldName: string, value: number): void;
|
||||
set(fieldName: string, value: boolean): void;
|
||||
get(fieldName: string): any;
|
||||
set(fieldName: string, fieldValue: any): void;
|
||||
set(fieldsObject: {}): void;
|
||||
send(hitType: string, ...fields: any[]): void;
|
||||
send(hitType: string, fieldsObject: {}): void;
|
||||
}
|
||||
|
||||
interface Model {
|
||||
get(fieldName: string): any;
|
||||
set(fieldName: string, fieldValue: any, temporary?: boolean): void;
|
||||
set(fields: {}, fieldValue?: null, temporary?: boolean): void;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -179,3 +179,16 @@ pixelProjection.rescale(12);
|
||||
|
||||
const point = pixelProjection.geoToPixel({ lat: 53, lng: 12 });
|
||||
pixelProjection.xyToGeo(point.x, point.y);
|
||||
|
||||
const engine = map.getEngine();
|
||||
engine.getAnimationDuration();
|
||||
engine.setAnimationDuration(1000);
|
||||
|
||||
engine.getAnimationEase();
|
||||
engine.setAnimationEase(H.util.animation.ease.EASE_IN_QUAD);
|
||||
|
||||
const engineListener = (e: Event) => {
|
||||
console.log(e);
|
||||
};
|
||||
engine.addEventListener('tap', engineListener);
|
||||
engine.removeEventListener('tap', engineListener);
|
||||
|
||||
261
types/heremaps/index.d.ts
vendored
261
types/heremaps/index.d.ts
vendored
@@ -264,6 +264,12 @@ declare namespace H {
|
||||
* @param opt_scope {Object=} - An optional scope to call the callback in.
|
||||
*/
|
||||
addOnDisposeCallback(callback: () => void, opt_scope?: {}): void;
|
||||
|
||||
/**
|
||||
* This returns the map's render engine
|
||||
* @return {H.map.render.p2d.RenderEngine} - map render engine
|
||||
*/
|
||||
getEngine(): H.map.render.p2d.RenderEngine;
|
||||
}
|
||||
|
||||
namespace Map {
|
||||
@@ -3606,6 +3612,261 @@ declare namespace H {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
namespace render {
|
||||
/**
|
||||
* This is an abstract class representing a render engine. Render engines are used to render the geographical position from a view model on the
|
||||
* screen (viewport element). The rendered result may be different for different engines, because every engine uses its own capabilities and
|
||||
* specific implementation to present the current view model data in best possible way. For example, 2D engines create a two-dimensional flat
|
||||
* map composed of tiles, while 3D engines can generate panoramas displaying the same coordinates as a 'street view'.
|
||||
*/
|
||||
class RenderEngine extends H.util.EventTarget {
|
||||
/**
|
||||
* Constructor
|
||||
* @param viewPort {H.map.ViewPort} - An object representing the map viewport
|
||||
* @param viewModel {H.map.ViewModel} - An object representing a view of the map
|
||||
* @param dataModel {H.map.DataModel} - An object encapsulating the data to be rendered on the map (layers and objects)
|
||||
* @param options {H.map.render.RenderEngine.Options} - An object containing the render engine initialization options
|
||||
*/
|
||||
constructor(viewPort: H.map.ViewPort, viewModel: H.map.ViewModel, dataModel: H.map.DataModel, options: H.map.render.RenderEngine.Options);
|
||||
|
||||
/**
|
||||
* This method adds a listener for a specific event.
|
||||
* Note that to prevent potential memory leaks, you must either call removeEventListener or dispose on the given object when you no longer need it.
|
||||
* @param type {string} - The name of the event
|
||||
* @param handler {!Function} - An event handler function
|
||||
* @param opt_capture {boolean=} - true indicates that the method should listen in the capture phase (bubble otherwise)
|
||||
* @param opt_scope {Object=} - An object defining the scope for the handler function
|
||||
*/
|
||||
addEventListener(type: string, handler: (evt: Event) => void, opt_capture?: boolean, opt_scope?: {}): void;
|
||||
|
||||
/**
|
||||
* This method removes a previously added listener from the EventTarget instance.
|
||||
* @param type {string} - The name of the event
|
||||
* @param handler {!Function} - A previously added event handler
|
||||
* @param opt_capture {boolean=} - true indicates that the method should listen in the capture phase (bubble otherwise)
|
||||
* @param opt_scope {Object=} - An object defining the scope for the handler function
|
||||
*/
|
||||
removeEventListener(type: string, handler: (evt: Event) => void, opt_capture?: boolean, opt_scope?: {}): void;
|
||||
|
||||
/**
|
||||
* This method dispatches an event on the EventTarget object.
|
||||
* @param evt {H.util.Event|string} - An object representing the event or a string with the event name
|
||||
*/
|
||||
dispatchEvent(evt: H.util.Event | string): void;
|
||||
|
||||
/**
|
||||
* This method removes listeners from the given object. Classes that extend EventTarget may need to override this method in order to remove
|
||||
* references to DOM Elements and additional listeners.
|
||||
*/
|
||||
dispose(): void;
|
||||
|
||||
/**
|
||||
* This method adds a callback which is triggered when the EventTarget object is being disposed.
|
||||
* @param callback {!Function} - The callback function.
|
||||
* @param opt_scope {Object=} - An optional scope for the callback function
|
||||
*/
|
||||
addOnDisposeCallback(callback: () => void, opt_scope?: {}): void;
|
||||
}
|
||||
|
||||
namespace RenderEngine {
|
||||
/**
|
||||
* An object containing the render engine initialization options
|
||||
*/
|
||||
interface Options {
|
||||
[key: string]: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* This object defines the modifiers to use for H.map.ViewPort#startInteraction.
|
||||
*/
|
||||
enum InteractionModifiers {
|
||||
/** changes zoom level during the interaction */
|
||||
ZOOM,
|
||||
/** changes map center during the interaction */
|
||||
HEADING,
|
||||
/** changes heading angle during the interaction */
|
||||
TILT,
|
||||
/** changes tilt angle during the interaction */
|
||||
INCLINE,
|
||||
/** changes incline angle during the interaction */
|
||||
COORD,
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The rendering states of the layer.
|
||||
*/
|
||||
enum RenderState {
|
||||
/**
|
||||
* Data loading/processing is still in progress, but there is nothing to render. In this state rendering engine might go to sleep mode after
|
||||
* certain amount of time to prevent draining of battery on the user device.
|
||||
*/
|
||||
PENDING,
|
||||
/** Data rendering or animation is in progress. */
|
||||
ACTIVE,
|
||||
/** Data rendering or animation is done. */
|
||||
DONE,
|
||||
}
|
||||
|
||||
/**
|
||||
* An object containing rendering parameters.
|
||||
*/
|
||||
interface RenderingParams {
|
||||
/**
|
||||
* The geographical area to render. Note that it is not the same as visible viewport. Specified bounds also include H.Map.Options#margin and
|
||||
* optionally an additional margin in case of DOM node rendering for a better rendering experience.
|
||||
* @type {H.geo.Rect}
|
||||
*/
|
||||
bounds: H.geo.Rect;
|
||||
|
||||
/**
|
||||
* The zoom level to render the data for.
|
||||
* @type {number}
|
||||
*/
|
||||
zoom: number;
|
||||
|
||||
/**
|
||||
* The coordinates of the screen center in CSS pixels.
|
||||
* @type {H.math.Point}
|
||||
*/
|
||||
screenCenter: H.math.Point;
|
||||
|
||||
/**
|
||||
* The coordinates relative to the screen center where the rendering has the highest priority. If the layer has to request and/or process data
|
||||
* asynchronously, it's recommended to prioritize the rendering close to this center.
|
||||
* @type {H.math.Point}
|
||||
*/
|
||||
priorityCenter: H.math.Point;
|
||||
|
||||
/**
|
||||
* The pixel projection to use to project geographical coordinates into screen coordinates and vice versa.
|
||||
* @type {H.geo.PixelProjection}
|
||||
*/
|
||||
projection: H.geo.PixelProjection;
|
||||
|
||||
/**
|
||||
* Indicates whether only cached data should be considered.
|
||||
* @type {boolean}
|
||||
*/
|
||||
cacheOnly: boolean;
|
||||
|
||||
/**
|
||||
* The size of the area to render.
|
||||
* @type {H.math.Size}
|
||||
*/
|
||||
size: H.math.Size;
|
||||
|
||||
/**
|
||||
* The pixelRatio to use for over-sampling in cases of high-resolution displays.
|
||||
* See https://developer.mozilla.org/en-US/docs/Web/API/Window/devicePixelRatio.
|
||||
* @type {number}
|
||||
*/
|
||||
pixelRatio: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Contains functionality specific to 2D map rendering.
|
||||
*/
|
||||
namespace p2d {
|
||||
/**
|
||||
* This class implements a map render engine. It presents a geographic location (camera data from a view model) and renders all map layers in
|
||||
* the order in which they are provided in a single 2D canvas element.
|
||||
*/
|
||||
class RenderEngine extends H.map.render.RenderEngine {
|
||||
/**
|
||||
* Constructor
|
||||
* @param viewPort {H.map.ViewPort} - An object representing the map viewport
|
||||
* @param viewModel {H.map.ViewModel} - An object representing a view of the map
|
||||
* @param dataModel {H.map.DataModel} - An object encapsulating the data to be rendered on the map (layers and objects)
|
||||
* @param options {H.map.render.RenderEngine.Options} - An object containing the render engine initialization options
|
||||
*/
|
||||
constructor(viewPort: H.map.ViewPort, viewModel: H.map.ViewModel, dataModel: H.map.DataModel, options: H.map.render.RenderEngine.Options);
|
||||
|
||||
/**
|
||||
* This method sets the length (duration) for all animations run by the render engine in milliseconds.
|
||||
* @param duration {number} - A value indicating the duration of animations in milliseconds
|
||||
*/
|
||||
setAnimationDuration(duration: number): void;
|
||||
|
||||
/**
|
||||
* This method retrieves the current setting indicating the length of animations (duration) run by the the render engine in milliseconds.
|
||||
* @return {number}
|
||||
*/
|
||||
getAnimationDuration(): number;
|
||||
|
||||
/**
|
||||
* This method sets a value indicating the easing to apply to animations run by the render engine.
|
||||
* @param easeFunction {Function(number)} - A function that alters the progress ratio of an animation. It receives an argument indicating
|
||||
* animation progress as a numeric value in the range between 0 and 1 and must return a numeric value in the same range.
|
||||
*/
|
||||
setAnimationEase(easeFunction: (progress: number) => number): void;
|
||||
|
||||
/**
|
||||
* This method retrieves the current setting representing the easing to be applied to animations.
|
||||
* @return {Function(number) => number} - A numeric value in the range 0 to 1
|
||||
*/
|
||||
getAnimationEase(): (progress: number) => number;
|
||||
|
||||
/**
|
||||
* This method resets animation settings on the render engine to defaults.
|
||||
* Duration is set to 300ms and easing to H.util.animation.ease.EASE_OUT_QUAD.
|
||||
*/
|
||||
resetAnimationDefaults(): void;
|
||||
|
||||
/**
|
||||
* This method adds a listener for a specific event.
|
||||
* Note that to prevent potential memory leaks, you must either call removeEventListener or dispose on the given object when you no longer need it.
|
||||
* @param type {string} - The name of the event
|
||||
* @param handler {!Function} - An event handler function
|
||||
* @param opt_capture {boolean=} - true indicates that the method should listen in the capture phase (bubble otherwise)
|
||||
* @param opt_scope {Object=} - An object defining the scope for the handler function
|
||||
*/
|
||||
addEventListener(type: string, handler: (evt: Event) => void, opt_capture?: boolean, opt_scope?: {}): void;
|
||||
|
||||
/**
|
||||
* This method removes a previously added listener from the EventTarget instance.
|
||||
* @param type {string} - The name of the event
|
||||
* @param handler {!Function} - A previously added event handler
|
||||
* @param opt_capture {boolean=} - true indicates that the method should listen in the capture phase (bubble otherwise)
|
||||
* @param opt_scope {Object=} - An object defining the scope for the handler function
|
||||
*/
|
||||
removeEventListener(type: string, handler: (evt: Event) => void, opt_capture?: boolean, opt_scope?: {}): void;
|
||||
|
||||
/**
|
||||
* This method dispatches an event on the EventTarget object.
|
||||
* @param evt {H.util.Event|string} - An object representing the event or a string with the event name
|
||||
*/
|
||||
dispatchEvent(evt: H.util.Event | string): void;
|
||||
|
||||
/**
|
||||
* This method removes listeners from the given object. Classes that extend EventTarget may need to override this method in order to remove
|
||||
* references to DOM Elements and additional listeners.
|
||||
*/
|
||||
dispose(): void;
|
||||
|
||||
/**
|
||||
* This method adds a callback which is triggered when the EventTarget object is being disposed.
|
||||
* @param callback {!Function} - The callback function.
|
||||
* @param opt_scope {Object=} - An optional scope for the callback function
|
||||
*/
|
||||
addOnDisposeCallback(callback: () => void, opt_scope?: {}): void;
|
||||
}
|
||||
|
||||
namespace RenderEngine {
|
||||
interface Options {
|
||||
/** Object describes how many cached zoom levels should be used as a base map background while base map tiles are */
|
||||
renderBaseBackground?: {};
|
||||
|
||||
/** The pixelRatio to use for over-sampling in cases of high-resolution displays */
|
||||
pixelRatio: number;
|
||||
|
||||
/** optional */
|
||||
enableSubpixelRendering?: boolean;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/***** mapevents *****/
|
||||
|
||||
8
types/meteor/server-render.d.ts
vendored
8
types/meteor/server-render.d.ts
vendored
@@ -7,10 +7,10 @@ declare module "meteor/server-render" {
|
||||
body?: string;
|
||||
htmlById?: { [key: string]: string };
|
||||
maybeMadeChanges?: boolean;
|
||||
appendToHead(html: string): void;
|
||||
appendToBody(html: string): void;
|
||||
appendToElementById(id: string, html: string): void;
|
||||
renderIntoElementById(id: string, html: string): void;
|
||||
appendToHead?(html: string): void;
|
||||
appendToBody?(html: string): void;
|
||||
appendToElementById?(id: string, html: string): void;
|
||||
renderIntoElementById?(id: string, html: string): void;
|
||||
}
|
||||
function onPageLoad(sink: Sink): Promise<any> | any;
|
||||
}
|
||||
|
||||
32
types/moji/index.d.ts
vendored
Normal file
32
types/moji/index.d.ts
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
// Type definitions for moji 0.5
|
||||
// Project: https://github.com/niwaringo/moji
|
||||
// Definitions by: Yasunori Ohoka <https://github.com/yasupeke>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.4
|
||||
|
||||
declare namespace moji {
|
||||
type Mojisyu = "ZE" | "HE" | "ZS" | "HS" | "HG" | "KK" | "ZK" | "HK";
|
||||
|
||||
interface MojisyuRange {
|
||||
start: number;
|
||||
end: number;
|
||||
}
|
||||
|
||||
interface MojisyuRegExp {
|
||||
regexp: RegExp;
|
||||
list: string[];
|
||||
}
|
||||
|
||||
interface Moji {
|
||||
convert(beforeType: Mojisyu, afterType: Mojisyu): Moji;
|
||||
trim(): Moji;
|
||||
filter(type: Mojisyu): Moji;
|
||||
reject(type: Mojisyu): Moji;
|
||||
toString(): string;
|
||||
}
|
||||
|
||||
function addMojisyu(type: string, mojisyu: MojisyuRange | MojisyuRegExp): void;
|
||||
}
|
||||
|
||||
declare function moji(moji: string): moji.Moji;
|
||||
export = moji;
|
||||
23
types/moji/moji-tests.ts
Normal file
23
types/moji/moji-tests.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import moji = require('moji');
|
||||
|
||||
moji('ABCD01234').convert('ZE', 'HE').toString();
|
||||
moji('ABCD01234').convert('HE', 'ZE').toString();
|
||||
// tslint:disable-next-line:no-irregular-whitespace
|
||||
moji(' ').convert('ZS', 'HS').toString();
|
||||
moji('あいうえお').convert('HG', 'KK').toString();
|
||||
moji('アイウエオ').convert('KK', 'HG').toString();
|
||||
moji('アイウエオ').convert('ZK', 'HK').toString();
|
||||
moji('アイウエオ').convert('HK', 'ZK').toString();
|
||||
moji('アイウエオ').convert('HK', 'ZK').convert('KK', 'HG').toString();
|
||||
|
||||
moji(' アイウエオ ').trim().toString();
|
||||
|
||||
moji('abcあいうアイウ123').filter('HG').toString();
|
||||
|
||||
moji('abcあいうアイウ123').reject('HG').toString();
|
||||
|
||||
moji.addMojisyu('ZE', { start: 0xff01, end: 0xff5e });
|
||||
moji.addMojisyu('HK', {
|
||||
regexp: /([\uff66-\uff9c]\uff9e)|([\uff8a-\uff8e]\uff9f)|([\uff61-\uff9f])/g,
|
||||
list: ["。", "「", "」"]
|
||||
});
|
||||
24
types/moji/tsconfig.json
Normal file
24
types/moji/tsconfig.json
Normal file
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es6",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"moji-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/moji/tslint.json
Normal file
1
types/moji/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
6
types/passport-jwt/index.d.ts
vendored
6
types/passport-jwt/index.d.ts
vendored
@@ -1,8 +1,9 @@
|
||||
// Type definitions for passport-jwt 2.0
|
||||
// Type definitions for passport-jwt 3.0
|
||||
// Project: https://github.com/themikenicholson/passport-jwt
|
||||
// Definitions by: TANAKA Koichi <https://github.com/mugeso/>
|
||||
// Alex Young <https://github.com/alsiola/>
|
||||
// David Ng <https://github.com/davidNHK/>
|
||||
// Carlos Eduardo Scheffer <https://github.com/carlosscheffer/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
@@ -15,7 +16,8 @@ export declare class Strategy extends PassportStrategy {
|
||||
}
|
||||
|
||||
export interface StrategyOptions {
|
||||
secretOrKey: string | Buffer;
|
||||
secretOrKey?: string | Buffer;
|
||||
secretOrKeyProvider?: any;
|
||||
jwtFromRequest: JwtFromRequestFunction;
|
||||
issuer?: string;
|
||||
audience?: string;
|
||||
|
||||
33
types/react-data-grid/index.d.ts
vendored
33
types/react-data-grid/index.d.ts
vendored
@@ -161,6 +161,13 @@ declare namespace AdazzleReactDataGrid {
|
||||
* @default false
|
||||
*/
|
||||
enableCellSelect?: boolean
|
||||
|
||||
/**
|
||||
* Enables cells to be dragged and dropped
|
||||
* @default false
|
||||
*/
|
||||
enableDragAndDrop?: boolean
|
||||
|
||||
/**
|
||||
* Called when a cell is selected.
|
||||
* @param coordinates The row and column indices of the selected cell.
|
||||
@@ -198,6 +205,13 @@ declare namespace AdazzleReactDataGrid {
|
||||
* @param row object behind the row
|
||||
*/
|
||||
onRowClick?: (rowIdx : number, row : object) => void
|
||||
|
||||
/**
|
||||
* An event function called when a row is expanded with the toggle
|
||||
* @param props OnRowExpandToggle object
|
||||
*/
|
||||
onRowExpandToggle?: (props: OnRowExpandToggle ) => void
|
||||
|
||||
/**
|
||||
* Responsible for returning an Array of values that can be used for filtering
|
||||
* a column that is column.filterable and using a column.filterRenderer that
|
||||
@@ -419,6 +433,24 @@ declare namespace AdazzleReactDataGrid {
|
||||
action: 'cellUpdate' | 'cellDrag' | 'columnFill' | 'copyPaste'
|
||||
}
|
||||
|
||||
/**
|
||||
* Information about the row toggler
|
||||
*/
|
||||
interface OnRowExpandToggle {
|
||||
/**
|
||||
* The name of the column group the row is in
|
||||
*/
|
||||
columnGroupName: string
|
||||
/**
|
||||
* The name of the expanded row
|
||||
*/
|
||||
name: string
|
||||
/**
|
||||
* If it should expand or not
|
||||
*/
|
||||
shouldExpand: boolean
|
||||
}
|
||||
|
||||
/**
|
||||
* Some filter to be applied to the grid's contents
|
||||
*/
|
||||
@@ -455,6 +487,7 @@ declare namespace AdazzleReactDataGrid {
|
||||
export import DragHandleDoubleClickEvent = AdazzleReactDataGrid.DragHandleDoubleClickEvent;
|
||||
export import CellCopyPasteEvent = AdazzleReactDataGrid.CellCopyPasteEvent;
|
||||
export import GridRowsUpdatedEvent = AdazzleReactDataGrid.GridRowsUpdatedEvent;
|
||||
export import OnRowExpandToggle = AdazzleReactDataGrid.OnRowExpandToggle;
|
||||
|
||||
// Actual classes exposed on module.exports
|
||||
/**
|
||||
|
||||
@@ -249,6 +249,13 @@ class Example extends React.Component<any, any> {
|
||||
this.setState({rows: rows});
|
||||
}
|
||||
|
||||
onRowExpandToggle = ({ columnGroupName, name, shouldExpand }:ReactDataGrid.OnRowExpandToggle ) => {
|
||||
let expandedRows = Object.assign({}, this.state.expandedRows);
|
||||
expandedRows[columnGroupName] = Object.assign({}, expandedRows[columnGroupName]);
|
||||
expandedRows[columnGroupName][name] = {isExpanded: shouldExpand};
|
||||
this.setState({expandedRows: expandedRows});
|
||||
}
|
||||
|
||||
onRowClick(rowIdx:number, row: Object) {
|
||||
// Do nothing, just test that it accepts an event
|
||||
}
|
||||
@@ -300,10 +307,12 @@ class Example extends React.Component<any, any> {
|
||||
<ReactDataGrid
|
||||
ref='grid'
|
||||
enableCellSelect={true}
|
||||
enableDragAndDrop={true}
|
||||
columns={this.getColumns()}
|
||||
rowGetter={this.getRowAt}
|
||||
rowsCount={this.getSize()}
|
||||
onGridRowsUpdated={this.handleGridRowsUpdated}
|
||||
onRowExpandToggle={this.onRowExpandToggle}
|
||||
toolbar={<Toolbar onAddRow={this.handleAddRow}/>}
|
||||
enableRowSelect={true}
|
||||
rowHeight={50}
|
||||
|
||||
5
types/react-ga/index.d.ts
vendored
5
types/react-ga/index.d.ts
vendored
@@ -1,6 +1,6 @@
|
||||
// Type definitions for react-ga 2.1
|
||||
// Project: https://github.com/react-ga/react-ga
|
||||
// Definitions by: Tim Aldridge <https://github.com/telshin>
|
||||
// Definitions by: Tim Aldridge <https://github.com/telshin>, Vasya Aksyonov <https://github.com/outring>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export interface EventArgs {
|
||||
@@ -54,7 +54,8 @@ export interface OutboundLinkArgs {
|
||||
}
|
||||
|
||||
export function initialize(trackingCode: string, options?: InitializeOptions): void;
|
||||
export function ga(): any;
|
||||
export function ga(): (...args: any[]) => any;
|
||||
export function ga(...args: any[]): any;
|
||||
export function set(fieldsObject: FieldsObject): void;
|
||||
export function send(fieldsObject: FieldsObject): void;
|
||||
export function pageview(path: string): void;
|
||||
|
||||
@@ -63,6 +63,12 @@ describe("Testing react-ga v2.1.2", () => {
|
||||
it("Able to make ga calls", () => {
|
||||
ga.ga();
|
||||
});
|
||||
it("Able to make ga calls with any arguments", () => {
|
||||
ga.ga("create", "UA-65432-1", "auto", "trackerName");
|
||||
});
|
||||
it("Able to make returned ga calls with any arguments", () => {
|
||||
ga.ga()("create", "UA-65432-1", "auto", "trackerName");
|
||||
});
|
||||
it("Able to make send calls", () => {
|
||||
const fieldObject: ga.FieldsObject = {
|
||||
page: '/users'
|
||||
|
||||
4
types/react-mdl/index.d.ts
vendored
4
types/react-mdl/index.d.ts
vendored
@@ -584,7 +584,7 @@ declare namespace __ReactMDL {
|
||||
class Tabs extends __MDLComponent<TabsProps> { }
|
||||
|
||||
|
||||
interface TextfieldProps extends MDLHTMLAttributes, React.DOMAttributes<Textfield> {
|
||||
interface TextfieldProps extends MDLHTMLAttributes, React.DOMAttributes<HTMLInputElement> {
|
||||
label: string;
|
||||
disabled?: boolean;
|
||||
error?: React.ReactNode;
|
||||
@@ -594,7 +594,7 @@ declare namespace __ReactMDL {
|
||||
id?: string;
|
||||
inputClassName?: string;
|
||||
maxRows?: number;
|
||||
onChange?: React.FormEventHandler<Textfield>;
|
||||
onChange?: React.FormEventHandler<HTMLInputElement>;
|
||||
pattern?: string;
|
||||
required?: boolean;
|
||||
rows?: number;
|
||||
|
||||
12
types/react-native/index.d.ts
vendored
12
types/react-native/index.d.ts
vendored
@@ -3743,6 +3743,18 @@ export interface SectionListProperties<ItemT> extends ScrollViewProperties {
|
||||
*/
|
||||
extraData?: any
|
||||
|
||||
/**
|
||||
* `getItemLayout` is an optional optimization that lets us skip measurement of dynamic
|
||||
* content if you know the height of items a priori. getItemLayout is the most efficient,
|
||||
* and is easy to use if you have fixed height items, for example:
|
||||
* ```
|
||||
* getItemLayout={(data, index) => (
|
||||
* {length: ITEM_HEIGHT, offset: ITEM_HEIGHT * index, index}
|
||||
* )}
|
||||
* ```
|
||||
*/
|
||||
getItemLayout?: (data: SectionListData<ItemT>[] | null, index: number) => {length: number, offset: number, index: number}
|
||||
|
||||
/**
|
||||
* How many items to render in the initial batch
|
||||
*/
|
||||
|
||||
10
types/react-redux/index.d.ts
vendored
10
types/react-redux/index.d.ts
vendored
@@ -7,9 +7,17 @@
|
||||
// Frank Tan <https://github.com/tansongyang>
|
||||
// Nicholas Boll <https://github.com/nicholasboll>
|
||||
// Dibyo Majumdar <https://github.com/mdibyo>
|
||||
// Prashant Deva <https://github.com/pdeva>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.4
|
||||
|
||||
|
||||
// Known Issue:
|
||||
// There is a known issue in TypeScript, which doesn't allow decorators to change the signature of the classes
|
||||
// they are decorating. Due to this, if you are using @connect() decorator in your code,
|
||||
// you will see a bunch of errors from TypeScript. The current workaround is to use connect() as a function call on
|
||||
// a separate line instead of as a decorator. Discussed in this github issue:
|
||||
// https://github.com/DefinitelyTyped/DefinitelyTyped/issues/20796
|
||||
|
||||
import * as React from 'react';
|
||||
import * as Redux from 'redux';
|
||||
|
||||
|
||||
3
types/react-router-dom/index.d.ts
vendored
3
types/react-router-dom/index.d.ts
vendored
@@ -1,4 +1,4 @@
|
||||
// Type definitions for React Router 4.0
|
||||
// Type definitions for React Router 4.2
|
||||
// Project: https://github.com/ReactTraining/react-router
|
||||
// Definitions by: Tanguy Krotoff <https://github.com/tkrotoff>
|
||||
// Huy Nguyen <https://github.com/huy-nguyen>
|
||||
@@ -52,5 +52,6 @@ export interface NavLinkProps extends LinkProps {
|
||||
exact?: boolean;
|
||||
strict?: boolean;
|
||||
isActive?<P>(match: match<P>, location: H.Location): boolean;
|
||||
location?: H.Location;
|
||||
}
|
||||
export class NavLink extends React.Component<NavLinkProps> {}
|
||||
|
||||
2
types/reactstrap/index.d.ts
vendored
2
types/reactstrap/index.d.ts
vendored
@@ -1,4 +1,4 @@
|
||||
// Type definitions for reactstrap 4.6
|
||||
// Type definitions for reactstrap 5.0
|
||||
// Project: https://github.com/reactstrap/reactstrap#readme
|
||||
// Definitions by: Ali Hammad Baig <https://github.com/alihammad>, Marco Falkenberg <https://github.com/mfal>, Danilo Barros <https://github.com/danilobjr>, Fábio Paiva <https://github.com/fabiopaiva>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
2
types/reactstrap/lib/Button.d.ts
vendored
2
types/reactstrap/lib/Button.d.ts
vendored
@@ -7,7 +7,7 @@ interface Props extends React.HTMLProps<HTMLButtonElement> {
|
||||
color?: string;
|
||||
disabled?: boolean;
|
||||
tag?: React.ReactType;
|
||||
getRef?: string | ((instance: HTMLButtonElement) => any);
|
||||
innerRef?: string | ((instance: HTMLButtonElement) => any);
|
||||
|
||||
onClick?: React.MouseEventHandler<any>;
|
||||
size?: any;
|
||||
|
||||
2
types/reactstrap/lib/CardLink.d.ts
vendored
2
types/reactstrap/lib/CardLink.d.ts
vendored
@@ -2,7 +2,7 @@ import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
tag?: React.ReactType;
|
||||
getRef?: string | ((instance: HTMLButtonElement) => any);
|
||||
innerRef?: string | ((instance: HTMLButtonElement) => any);
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
href?: string;
|
||||
|
||||
2
types/reactstrap/lib/Form.d.ts
vendored
2
types/reactstrap/lib/Form.d.ts
vendored
@@ -3,7 +3,7 @@ import { CSSModule } from '../index';
|
||||
interface Props extends React.HTMLProps<HTMLFormElement> {
|
||||
inline?: boolean;
|
||||
tag?: React.ReactType;
|
||||
getRef?: string | ((instance: HTMLButtonElement) => any);
|
||||
innerRef?: string | ((instance: HTMLButtonElement) => any);
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
}
|
||||
|
||||
2
types/reactstrap/lib/Input.d.ts
vendored
2
types/reactstrap/lib/Input.d.ts
vendored
@@ -39,7 +39,7 @@ interface InputProps extends Intermediate {
|
||||
state?: string;
|
||||
valid?: boolean;
|
||||
tag?: React.ReactType;
|
||||
getRef?: string | ((instance: HTMLInputElement) => any);
|
||||
innerRef?: string | ((instance: HTMLInputElement) => any);
|
||||
static?: boolean;
|
||||
addon?: boolean;
|
||||
className?: string;
|
||||
|
||||
2
types/reactstrap/lib/NavLink.d.ts
vendored
2
types/reactstrap/lib/NavLink.d.ts
vendored
@@ -2,7 +2,7 @@ import { CSSModule } from '../index';
|
||||
|
||||
interface Props extends React.HTMLProps<HTMLAnchorElement> {
|
||||
tag?: React.ReactType;
|
||||
getRef?: string | ((instance: HTMLButtonElement) => any);
|
||||
innerRef?: string | ((instance: HTMLButtonElement) => any);
|
||||
disabled?: boolean;
|
||||
active?: boolean;
|
||||
className?: string;
|
||||
|
||||
@@ -3302,7 +3302,7 @@ class Example107 extends React.Component {
|
||||
private input: HTMLInputElement;
|
||||
|
||||
render() {
|
||||
return <Input type="file" getRef={(input) => { this.input = input; }} />;
|
||||
return <Input type="file" innerRef={(input) => { this.input = input; }} />;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
87
types/reactstrap/v4/index.d.ts
vendored
Normal file
87
types/reactstrap/v4/index.d.ts
vendored
Normal file
@@ -0,0 +1,87 @@
|
||||
// Type definitions for reactstrap 4.6
|
||||
// Project: https://github.com/reactstrap/reactstrap#readme
|
||||
// Definitions by: Ali Hammad Baig <https://github.com/alihammad>, Marco Falkenberg <https://github.com/mfal>, Danilo Barros <https://github.com/danilobjr>, Fábio Paiva <https://github.com/fabiopaiva>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
export interface CSSModule {
|
||||
[className: string]: string;
|
||||
}
|
||||
|
||||
export { default as Alert } from './lib/Alert';
|
||||
export { default as Badge } from './lib/Badge';
|
||||
export { default as Breadcrumb } from './lib/Breadcrumb';
|
||||
export { default as BreadcrumbItem } from './lib/BreadcrumbItem';
|
||||
export { default as Button } from './lib/Button';
|
||||
export { default as ButtonDropdown } from './lib/ButtonDropdown';
|
||||
export { default as ButtonGroup } from './lib/ButtonGroup';
|
||||
export { default as ButtonToolbar } from './lib/ButtonToolbar';
|
||||
export { default as Card } from './lib/Card';
|
||||
export { default as CardBody } from './lib/CardBody';
|
||||
export { default as CardBlock } from './lib/CardBlock';
|
||||
export { default as CardColumns } from './lib/CardColumns';
|
||||
export { default as CardDeck } from './lib/CardDeck';
|
||||
export { default as CardFooter } from './lib/CardFooter';
|
||||
export { default as CardGroup } from './lib/CardGroup';
|
||||
export { default as CardHeader } from './lib/CardHeader';
|
||||
export { default as CardImg } from './lib/CardImg';
|
||||
export { default as CardImgOverlay } from './lib/CardImgOverlay';
|
||||
export { default as CardLink } from './lib/CardLink';
|
||||
export { default as CardSubtitle } from './lib/CardSubtitle';
|
||||
export { default as CardText } from './lib/CardText';
|
||||
export { default as CardTitle } from './lib/CardTitle';
|
||||
export { default as Col } from './lib/Col';
|
||||
export { default as Collapse } from './lib/Collapse';
|
||||
export { default as Container } from './lib/Container';
|
||||
export { default as Dropdown } from './lib/Dropdown';
|
||||
export { default as DropdownItem } from './lib/DropdownItem';
|
||||
export { default as DropdownMenu } from './lib/DropdownMenu';
|
||||
export { default as DropdownToggle } from './lib/DropdownToggle';
|
||||
export { default as Fade } from './lib/Fade';
|
||||
export { default as Form } from './lib/Form';
|
||||
export { default as FormFeedback } from './lib/FormFeedback';
|
||||
export { default as FormGroup } from './lib/FormGroup';
|
||||
export { default as FormText } from './lib/FormText';
|
||||
export { default as Input } from './lib/Input';
|
||||
export { default as InputGroup } from './lib/InputGroup';
|
||||
export { default as InputGroupAddon } from './lib/InputGroupAddon';
|
||||
export { default as InputGroupButton } from './lib/InputGroupButton';
|
||||
export { default as Jumbotron } from './lib/Jumbotron';
|
||||
export { default as Label } from './lib/Label';
|
||||
export { default as ListGroup } from './lib/ListGroup';
|
||||
export { default as ListGroupItem } from './lib/ListGroupItem';
|
||||
export { default as ListGroupItemHeading } from './lib/ListGroupItemHeading';
|
||||
export { default as ListGroupItemText } from './lib/ListGroupItemText';
|
||||
export { default as Media } from './lib/Media';
|
||||
export { default as Modal } from './lib/Modal';
|
||||
export { default as ModalBody } from './lib/ModalBody';
|
||||
export { default as ModalFooter } from './lib/ModalFooter';
|
||||
export { default as ModalHeader } from './lib/ModalHeader';
|
||||
export { default as Nav } from './lib/Nav';
|
||||
export { default as Navbar } from './lib/Navbar';
|
||||
export { default as NavbarBrand } from './lib/NavbarBrand';
|
||||
export { default as NavbarToggler } from './lib/NavbarToggler';
|
||||
export { default as NavDropdown } from './lib/NavDropdown';
|
||||
export { default as NavItem } from './lib/NavItem';
|
||||
export { default as NavLink } from './lib/NavLink';
|
||||
export { default as Pagination } from './lib/Pagination';
|
||||
export { default as PaginationItem } from './lib/PaginationItem';
|
||||
export { default as PaginationLink } from './lib/PaginationLink';
|
||||
export { default as Popover } from './lib/Popover';
|
||||
export { default as PopoverContent } from './lib/PopoverContent';
|
||||
export { default as PopoverTitle } from './lib/PopoverTitle';
|
||||
export { default as Progress } from './lib/Progress';
|
||||
export { default as Row } from './lib/Row';
|
||||
export { default as TabContent } from './lib/TabContent';
|
||||
export { default as Table } from './lib/Table';
|
||||
export { default as TabPane } from './lib/TabPane';
|
||||
export { default as Tag } from './lib/Tag';
|
||||
export { default as TetherContent } from './lib/TetherContent';
|
||||
export { default as Tooltip } from './lib/Tooltip';
|
||||
export {
|
||||
UncontrolledAlert,
|
||||
UncontrolledButtonDropdown,
|
||||
UncontrolledDropdown,
|
||||
UncontrolledNavDropdown,
|
||||
UncontrolledTooltip
|
||||
} from './lib/Uncontrolled';
|
||||
19
types/reactstrap/v4/lib/Alert.d.ts
vendored
Normal file
19
types/reactstrap/v4/lib/Alert.d.ts
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
export interface UncontrolledProps {
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
color?: string;
|
||||
tag?: React.ReactType;
|
||||
transitionAppearTimeout?: number;
|
||||
transitionEnterTimeout?: number;
|
||||
transitionLeaveTimeout?: number;
|
||||
}
|
||||
|
||||
interface Props extends UncontrolledProps {
|
||||
isOpen?: boolean;
|
||||
toggle?: () => void;
|
||||
}
|
||||
|
||||
declare var Alert: React.StatelessComponent<Props>;
|
||||
export default Alert;
|
||||
12
types/reactstrap/v4/lib/Badge.d.ts
vendored
Normal file
12
types/reactstrap/v4/lib/Badge.d.ts
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
color?: string;
|
||||
pill?: boolean;
|
||||
tag?: React.ReactType;
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
}
|
||||
|
||||
declare var Badge: React.StatelessComponent<Props>;
|
||||
export default Badge;
|
||||
10
types/reactstrap/v4/lib/Breadcrumb.d.ts
vendored
Normal file
10
types/reactstrap/v4/lib/Breadcrumb.d.ts
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
tag?: string;
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
}
|
||||
|
||||
declare var Breadcrumb: React.StatelessComponent<Props>;
|
||||
export default Breadcrumb;
|
||||
15
types/reactstrap/v4/lib/BreadcrumbItem.d.ts
vendored
Normal file
15
types/reactstrap/v4/lib/BreadcrumbItem.d.ts
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
tag?: React.ReactType;
|
||||
active?: boolean;
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
// if a is passed as a string
|
||||
// this could be href
|
||||
[others: string]: any;
|
||||
}
|
||||
|
||||
declare var BreadcrumbItem: React.StatelessComponent<Props>;
|
||||
export default BreadcrumbItem;
|
||||
|
||||
21
types/reactstrap/v4/lib/Button.d.ts
vendored
Normal file
21
types/reactstrap/v4/lib/Button.d.ts
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props extends React.HTMLProps<HTMLButtonElement> {
|
||||
outline?: boolean;
|
||||
active?: boolean;
|
||||
block?: boolean;
|
||||
color?: string;
|
||||
disabled?: boolean;
|
||||
tag?: React.ReactType;
|
||||
getRef?: string | ((instance: HTMLButtonElement) => any);
|
||||
|
||||
onClick?: React.MouseEventHandler<any>;
|
||||
size?: any;
|
||||
id?: string;
|
||||
style?: React.CSSProperties;
|
||||
|
||||
cssModule?: CSSModule;
|
||||
}
|
||||
|
||||
declare var Button: React.StatelessComponent<Props>;
|
||||
export default Button;
|
||||
12
types/reactstrap/v4/lib/ButtonDropdown.d.ts
vendored
Normal file
12
types/reactstrap/v4/lib/ButtonDropdown.d.ts
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
import {
|
||||
UncontrolledProps as DropdownUncontrolledProps,
|
||||
Props as DropdownProps
|
||||
} from './Dropdown';
|
||||
|
||||
// tslint:disable-next-line
|
||||
export interface UncontrolledProps extends DropdownUncontrolledProps { }
|
||||
// tslint:disable-next-line
|
||||
interface Props extends DropdownProps { }
|
||||
|
||||
declare var ButtonDropdown: React.StatelessComponent<Props>;
|
||||
export default ButtonDropdown;
|
||||
14
types/reactstrap/v4/lib/ButtonGroup.d.ts
vendored
Normal file
14
types/reactstrap/v4/lib/ButtonGroup.d.ts
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
tag?: React.ReactType;
|
||||
'aria-label'?: string;
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
role?: string;
|
||||
size?: string;
|
||||
vertical?: boolean;
|
||||
}
|
||||
|
||||
declare var ButtonGroup: React.StatelessComponent<Props>;
|
||||
export default ButtonGroup;
|
||||
12
types/reactstrap/v4/lib/ButtonToolbar.d.ts
vendored
Normal file
12
types/reactstrap/v4/lib/ButtonToolbar.d.ts
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
tag?: React.ReactType;
|
||||
'aria-label'?: string;
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
role?: string;
|
||||
}
|
||||
|
||||
declare var ButtonToolbar: React.StatelessComponent<Props>;
|
||||
export default ButtonToolbar;
|
||||
16
types/reactstrap/v4/lib/Card.d.ts
vendored
Normal file
16
types/reactstrap/v4/lib/Card.d.ts
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
tag?: React.ReactType;
|
||||
inverse?: boolean;
|
||||
color?: string;
|
||||
block?: boolean;
|
||||
outline?: boolean;
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
style?: React.CSSProperties;
|
||||
}
|
||||
|
||||
declare var Card: React.StatelessComponent<Props>;
|
||||
export default Card;
|
||||
|
||||
11
types/reactstrap/v4/lib/CardBlock.d.ts
vendored
Normal file
11
types/reactstrap/v4/lib/CardBlock.d.ts
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
tag?: React.ReactType;
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
}
|
||||
|
||||
declare var CardBlock: React.StatelessComponent<Props>;
|
||||
export default CardBlock;
|
||||
|
||||
10
types/reactstrap/v4/lib/CardBody.d.ts
vendored
Normal file
10
types/reactstrap/v4/lib/CardBody.d.ts
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
tag?: React.ReactType;
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
}
|
||||
|
||||
declare var CardBody: React.StatelessComponent<Props>;
|
||||
export default CardBody;
|
||||
10
types/reactstrap/v4/lib/CardColumns.d.ts
vendored
Normal file
10
types/reactstrap/v4/lib/CardColumns.d.ts
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
tag?: React.ReactType;
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
}
|
||||
|
||||
declare var CardColumns: React.StatelessComponent<Props>;
|
||||
export default CardColumns;
|
||||
10
types/reactstrap/v4/lib/CardDeck.d.ts
vendored
Normal file
10
types/reactstrap/v4/lib/CardDeck.d.ts
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
tag?: React.ReactType;
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
}
|
||||
|
||||
declare var CardDeck: React.StatelessComponent<Props>;
|
||||
export default CardDeck;
|
||||
10
types/reactstrap/v4/lib/CardFooter.d.ts
vendored
Normal file
10
types/reactstrap/v4/lib/CardFooter.d.ts
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
tag?: React.ReactType;
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
}
|
||||
|
||||
declare var CardFooter: React.StatelessComponent<Props>;
|
||||
export default CardFooter;
|
||||
10
types/reactstrap/v4/lib/CardGroup.d.ts
vendored
Normal file
10
types/reactstrap/v4/lib/CardGroup.d.ts
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
tag?: React.ReactType;
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
}
|
||||
|
||||
declare var CardGroup: React.StatelessComponent<Props>;
|
||||
export default CardGroup;
|
||||
10
types/reactstrap/v4/lib/CardHeader.d.ts
vendored
Normal file
10
types/reactstrap/v4/lib/CardHeader.d.ts
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
tag?: React.ReactType;
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
}
|
||||
|
||||
declare var CardHeader: React.StatelessComponent<Props>;
|
||||
export default CardHeader;
|
||||
16
types/reactstrap/v4/lib/CardImg.d.ts
vendored
Normal file
16
types/reactstrap/v4/lib/CardImg.d.ts
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
tag?: React.ReactType;
|
||||
top?: boolean;
|
||||
bottom?: boolean;
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
src?: string;
|
||||
width?: string;
|
||||
height?: string;
|
||||
alt?: string;
|
||||
}
|
||||
|
||||
declare var CardImg: React.StatelessComponent<Props>;
|
||||
export default CardImg;
|
||||
10
types/reactstrap/v4/lib/CardImgOverlay.d.ts
vendored
Normal file
10
types/reactstrap/v4/lib/CardImgOverlay.d.ts
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
tag?: React.ReactType;
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
}
|
||||
|
||||
declare var CardImgOverlay: React.StatelessComponent<Props>;
|
||||
export default CardImgOverlay;
|
||||
12
types/reactstrap/v4/lib/CardLink.d.ts
vendored
Normal file
12
types/reactstrap/v4/lib/CardLink.d.ts
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
tag?: React.ReactType;
|
||||
getRef?: string | ((instance: HTMLButtonElement) => any);
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
href?: string;
|
||||
}
|
||||
|
||||
declare var CardLink: React.StatelessComponent<Props>;
|
||||
export default CardLink;
|
||||
10
types/reactstrap/v4/lib/CardSubtitle.d.ts
vendored
Normal file
10
types/reactstrap/v4/lib/CardSubtitle.d.ts
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
tag?: React.ReactType;
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
}
|
||||
|
||||
declare var CardSubtitle: React.StatelessComponent<Props>;
|
||||
export default CardSubtitle;
|
||||
10
types/reactstrap/v4/lib/CardText.d.ts
vendored
Normal file
10
types/reactstrap/v4/lib/CardText.d.ts
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
tag?: React.ReactType;
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
}
|
||||
|
||||
declare var CardText: React.StatelessComponent<Props>;
|
||||
export default CardText;
|
||||
10
types/reactstrap/v4/lib/CardTitle.d.ts
vendored
Normal file
10
types/reactstrap/v4/lib/CardTitle.d.ts
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
tag?: React.ReactType;
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
}
|
||||
|
||||
declare var CardTitle: React.StatelessComponent<Props>;
|
||||
export default CardTitle;
|
||||
24
types/reactstrap/v4/lib/Col.d.ts
vendored
Normal file
24
types/reactstrap/v4/lib/Col.d.ts
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
export type ColumnProps
|
||||
= string
|
||||
| boolean
|
||||
| number
|
||||
| {
|
||||
size?: boolean | number | string
|
||||
push?: string | number
|
||||
pull?: string | number
|
||||
offset?: string | number
|
||||
};
|
||||
|
||||
interface Props extends React.HTMLProps<HTMLDivElement> {
|
||||
xs?: ColumnProps;
|
||||
sm?: ColumnProps;
|
||||
md?: ColumnProps;
|
||||
lg?: ColumnProps;
|
||||
xl?: ColumnProps;
|
||||
|
||||
//custom widths
|
||||
widths?: string[];
|
||||
}
|
||||
|
||||
declare var Col: React.StatelessComponent<Props>;
|
||||
export default Col;
|
||||
18
types/reactstrap/v4/lib/Collapse.d.ts
vendored
Normal file
18
types/reactstrap/v4/lib/Collapse.d.ts
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props extends React.HTMLProps<HTMLElement> {
|
||||
isOpen?: boolean;
|
||||
classNames?: string;
|
||||
cssModule?: CSSModule;
|
||||
tag?: React.ReactType;
|
||||
navbar?: boolean;
|
||||
delay?: {
|
||||
show: number
|
||||
hide: number
|
||||
};
|
||||
onOpened?: () => void;
|
||||
onClosed?: () => void;
|
||||
}
|
||||
|
||||
declare var Collapse: React.StatelessComponent<Props>;
|
||||
export default Collapse;
|
||||
11
types/reactstrap/v4/lib/Container.d.ts
vendored
Normal file
11
types/reactstrap/v4/lib/Container.d.ts
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
tag?: React.ReactType;
|
||||
fluid?: boolean;
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
}
|
||||
|
||||
declare var Container: React.StatelessComponent<Props>;
|
||||
export default Container;
|
||||
22
types/reactstrap/v4/lib/Dropdown.d.ts
vendored
Normal file
22
types/reactstrap/v4/lib/Dropdown.d.ts
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
/// <reference types='tether' />
|
||||
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
export interface UncontrolledProps {
|
||||
isOpen?: boolean;
|
||||
toggle?: () => void;
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
}
|
||||
|
||||
export interface Props extends UncontrolledProps {
|
||||
disabled?: boolean;
|
||||
dropup?: boolean;
|
||||
group?: boolean;
|
||||
size?: string;
|
||||
tag?: React.ReactType;
|
||||
tether?: boolean | Tether.ITetherOptions;
|
||||
}
|
||||
|
||||
declare var Dropdown: React.StatelessComponent<Props>;
|
||||
export default Dropdown;
|
||||
15
types/reactstrap/v4/lib/DropdownItem.d.ts
vendored
Normal file
15
types/reactstrap/v4/lib/DropdownItem.d.ts
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
disabled?: boolean;
|
||||
divider?: boolean;
|
||||
tag?: React.ReactType;
|
||||
header?: boolean;
|
||||
onClick?: (event: React.MouseEvent<any>) => void;
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
href?: string;
|
||||
}
|
||||
|
||||
declare var DropdownItem: React.StatelessComponent<Props>;
|
||||
export default DropdownItem;
|
||||
11
types/reactstrap/v4/lib/DropdownMenu.d.ts
vendored
Normal file
11
types/reactstrap/v4/lib/DropdownMenu.d.ts
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
tag?: React.ReactType;
|
||||
right?: boolean;
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
}
|
||||
|
||||
declare var DropdownMenu: React.StatelessComponent<Props>;
|
||||
export default DropdownMenu;
|
||||
19
types/reactstrap/v4/lib/DropdownToggle.d.ts
vendored
Normal file
19
types/reactstrap/v4/lib/DropdownToggle.d.ts
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
caret?: boolean;
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
disabled?: boolean;
|
||||
onClick?: React.MouseEventHandler<any>;
|
||||
'data-toggle'?: string;
|
||||
'aria-haspopup'?: boolean;
|
||||
split?: boolean;
|
||||
tag?: React.ReactType;
|
||||
nav?: boolean;
|
||||
color?: string;
|
||||
size?: string;
|
||||
}
|
||||
|
||||
declare var DropdownToggle: React.StatelessComponent<Props>;
|
||||
export default DropdownToggle;
|
||||
20
types/reactstrap/v4/lib/Fade.d.ts
vendored
Normal file
20
types/reactstrap/v4/lib/Fade.d.ts
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
baseClass?: string;
|
||||
baseClassIn?: string;
|
||||
tag?: React.ReactType;
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
transitionAppearTimeout?: number;
|
||||
transitionEnterTimeout?: number;
|
||||
transitionLeaveTimeout?: number;
|
||||
transitionAppear?: boolean;
|
||||
transitionEnter?: boolean;
|
||||
transitionLeave?: boolean;
|
||||
onLeave?: () => void;
|
||||
onEnter?: () => void;
|
||||
}
|
||||
|
||||
declare var Fade: React.StatelessComponent<Props>;
|
||||
export default Fade;
|
||||
12
types/reactstrap/v4/lib/Form.d.ts
vendored
Normal file
12
types/reactstrap/v4/lib/Form.d.ts
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props extends React.HTMLProps<HTMLFormElement> {
|
||||
inline?: boolean;
|
||||
tag?: React.ReactType;
|
||||
getRef?: string | ((instance: HTMLButtonElement) => any);
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
}
|
||||
|
||||
declare var Form: React.StatelessComponent<Props>;
|
||||
export default Form;
|
||||
10
types/reactstrap/v4/lib/FormFeedback.d.ts
vendored
Normal file
10
types/reactstrap/v4/lib/FormFeedback.d.ts
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
tag?: string;
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
}
|
||||
|
||||
declare var FormFeedback: React.StatelessComponent<Props>;
|
||||
export default FormFeedback;
|
||||
14
types/reactstrap/v4/lib/FormGroup.d.ts
vendored
Normal file
14
types/reactstrap/v4/lib/FormGroup.d.ts
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props extends React.HTMLProps<HTMLDivElement> {
|
||||
row?: boolean;
|
||||
check?: boolean;
|
||||
disabled?: boolean;
|
||||
tag?: React.ReactType;
|
||||
color?: string;
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
}
|
||||
|
||||
declare var FormGroup: React.StatelessComponent<Props>;
|
||||
export default FormGroup;
|
||||
12
types/reactstrap/v4/lib/FormText.d.ts
vendored
Normal file
12
types/reactstrap/v4/lib/FormText.d.ts
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
inline?: boolean;
|
||||
tag?: React.ReactType;
|
||||
color?: string;
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
}
|
||||
|
||||
declare var FormText: React.StatelessComponent<Props>;
|
||||
export default FormText;
|
||||
52
types/reactstrap/v4/lib/Input.d.ts
vendored
Normal file
52
types/reactstrap/v4/lib/Input.d.ts
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
type InputType =
|
||||
| 'text'
|
||||
| 'email'
|
||||
| 'select'
|
||||
| 'file'
|
||||
| 'radio'
|
||||
| 'checkbox'
|
||||
| 'textarea'
|
||||
| 'button'
|
||||
| 'reset'
|
||||
| 'submit'
|
||||
| 'date'
|
||||
| 'datetime-local'
|
||||
| 'hidden'
|
||||
| 'image'
|
||||
| 'month'
|
||||
| 'number'
|
||||
| 'range'
|
||||
| 'search'
|
||||
| 'tel'
|
||||
| 'url'
|
||||
| 'week'
|
||||
| 'password'
|
||||
| 'datetime'
|
||||
| 'time'
|
||||
| 'color';
|
||||
|
||||
// Intermediate interface to "redefine" the type of size to string
|
||||
// size:number => size:any => size:string
|
||||
interface Intermediate extends React.InputHTMLAttributes<HTMLInputElement> {
|
||||
size?: any;
|
||||
}
|
||||
|
||||
interface InputProps extends Intermediate {
|
||||
type?: InputType;
|
||||
size?: string;
|
||||
state?: string;
|
||||
valid?: boolean;
|
||||
tag?: React.ReactType;
|
||||
getRef?: string | ((instance: HTMLInputElement) => any);
|
||||
static?: boolean;
|
||||
addon?: boolean;
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
// We don't have the property 'static' here because 'static' is a reserved keyword in TypeScript
|
||||
// Maybe reactstrap will support an 'isStatic' alias in the future
|
||||
}
|
||||
|
||||
declare var Input: React.StatelessComponent<InputProps>;
|
||||
export default Input;
|
||||
11
types/reactstrap/v4/lib/InputGroup.d.ts
vendored
Normal file
11
types/reactstrap/v4/lib/InputGroup.d.ts
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
tag?: React.ReactType;
|
||||
size?: string;
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
}
|
||||
|
||||
declare var InputGroup: React.StatelessComponent<Props>;
|
||||
export default InputGroup;
|
||||
10
types/reactstrap/v4/lib/InputGroupAddon.d.ts
vendored
Normal file
10
types/reactstrap/v4/lib/InputGroupAddon.d.ts
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
tag?: React.ReactType;
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
}
|
||||
|
||||
declare var InputGroupAddon: React.StatelessComponent<Props>;
|
||||
export default InputGroupAddon;
|
||||
13
types/reactstrap/v4/lib/InputGroupButton.d.ts
vendored
Normal file
13
types/reactstrap/v4/lib/InputGroupButton.d.ts
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
tag?: React.ReactType;
|
||||
groupClassName?: string;
|
||||
groupAttributes?: any;
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
color?: string;
|
||||
}
|
||||
|
||||
declare var InputGroupButton: React.StatelessComponent<Props>;
|
||||
export default InputGroupButton;
|
||||
11
types/reactstrap/v4/lib/Jumbotron.d.ts
vendored
Normal file
11
types/reactstrap/v4/lib/Jumbotron.d.ts
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
tag?: React.ReactType;
|
||||
fluid?: boolean;
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
}
|
||||
|
||||
declare var Jumbotron: React.StatelessComponent<Props>;
|
||||
export default Jumbotron;
|
||||
26
types/reactstrap/v4/lib/Label.d.ts
vendored
Normal file
26
types/reactstrap/v4/lib/Label.d.ts
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
import { CSSModule } from '../index';
|
||||
import { ColumnProps } from './Col';
|
||||
|
||||
interface Intermediate extends React.LabelHTMLAttributes<HTMLLabelElement> {
|
||||
size?: any;
|
||||
}
|
||||
|
||||
interface Props extends Intermediate {
|
||||
hidden?: boolean;
|
||||
check?: boolean;
|
||||
inline?: boolean;
|
||||
disabled?: boolean;
|
||||
size?: string;
|
||||
for?: string;
|
||||
tag?: string;
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
xs?: ColumnProps;
|
||||
sm?: ColumnProps;
|
||||
md?: ColumnProps;
|
||||
lg?: ColumnProps;
|
||||
xl?: ColumnProps;
|
||||
}
|
||||
|
||||
declare var Label: React.StatelessComponent<Props>;
|
||||
export default Label;
|
||||
11
types/reactstrap/v4/lib/ListGroup.d.ts
vendored
Normal file
11
types/reactstrap/v4/lib/ListGroup.d.ts
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
tag?: React.ReactType;
|
||||
flush?: boolean;
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
}
|
||||
|
||||
declare var ListGroup: React.StatelessComponent<Props>;
|
||||
export default ListGroup;
|
||||
17
types/reactstrap/v4/lib/ListGroupItem.d.ts
vendored
Normal file
17
types/reactstrap/v4/lib/ListGroupItem.d.ts
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
tag?: React.ReactType;
|
||||
active?: boolean;
|
||||
disabled?: boolean;
|
||||
color?: string;
|
||||
action?: boolean;
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
href?: string;
|
||||
|
||||
onClick?: React.MouseEventHandler<any>;
|
||||
}
|
||||
|
||||
declare var ListGroupItem: React.StatelessComponent<Props>;
|
||||
export default ListGroupItem;
|
||||
10
types/reactstrap/v4/lib/ListGroupItemHeading.d.ts
vendored
Normal file
10
types/reactstrap/v4/lib/ListGroupItemHeading.d.ts
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
tag?: React.ReactType;
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
}
|
||||
|
||||
declare var ListGroupItemHeading: React.StatelessComponent<Props>;
|
||||
export default ListGroupItemHeading;
|
||||
10
types/reactstrap/v4/lib/ListGroupItemText.d.ts
vendored
Normal file
10
types/reactstrap/v4/lib/ListGroupItemText.d.ts
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
tag?: React.ReactType;
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
}
|
||||
|
||||
declare var ListGroupItemText: React.StatelessComponent<Props>;
|
||||
export default ListGroupItemText;
|
||||
21
types/reactstrap/v4/lib/Media.d.ts
vendored
Normal file
21
types/reactstrap/v4/lib/Media.d.ts
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
body?: boolean;
|
||||
bottom?: boolean;
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
heading?: boolean;
|
||||
left?: boolean;
|
||||
list?: boolean;
|
||||
middle?: boolean;
|
||||
object?: boolean;
|
||||
right?: boolean;
|
||||
tag?: React.ReactType;
|
||||
top?: boolean;
|
||||
href?: string;
|
||||
alt?: string;
|
||||
}
|
||||
|
||||
declare var Media: React.StatelessComponent<Props>;
|
||||
export default Media;
|
||||
23
types/reactstrap/v4/lib/Modal.d.ts
vendored
Normal file
23
types/reactstrap/v4/lib/Modal.d.ts
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface Props {
|
||||
isOpen?: boolean;
|
||||
autoFocus?: boolean;
|
||||
size?: string;
|
||||
toggle?: () => void;
|
||||
keyboard?: boolean;
|
||||
backdrop?: boolean | 'static';
|
||||
onEnter?: () => void;
|
||||
onExit?: () => void;
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
wrapClassName?: string;
|
||||
modalClassName?: string;
|
||||
backdropClassName?: string;
|
||||
contentClassName?: string;
|
||||
zIndex?: number | string;
|
||||
fade?: boolean;
|
||||
}
|
||||
|
||||
declare var Modal: React.StatelessComponent<Props>;
|
||||
export default Modal;
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user