Merge branch 'master' into react-navigation-injected-props-state-leaf-route

This commit is contained in:
Alec Hill
2018-11-07 16:06:41 +00:00
committed by GitHub
471 changed files with 21031 additions and 2854 deletions
+389 -171
View File
File diff suppressed because it is too large Load Diff
+12
View File
@@ -540,6 +540,12 @@
"sourceRepoURL": "https://github.com/code-chris/extended-listbox",
"asOfVersion": "4.0.1"
},
{
"libraryName": "fast-diff",
"typingsPackageName": "fast-diff",
"sourceRepoURL": "https://github.com/jhchen/fast-diff",
"asOfVersion": "1.2.0"
},
{
"libraryName": "JSON-Patch",
"typingsPackageName": "fast-json-patch",
@@ -978,6 +984,12 @@
"sourceRepoURL": "https://github.com/mweststrate/mobservable-react",
"asOfVersion": "1.0.0"
},
{
"libraryName": "Mobx Cookie",
"typingsPackageName": "mobx-cookie",
"sourceRepoURL": "https://github.com/will-stone/mobx-cookie",
"asOfVersion": "1.1.0"
},
{
"libraryName": "Moment",
"typingsPackageName": "moment",
File diff suppressed because it is too large Load Diff
+3265
View File
File diff suppressed because it is too large Load Diff
+28
View File
@@ -0,0 +1,28 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"esnext",
"dom"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true,
"esModuleInterop": true
},
"files": [
"index.d.ts",
"ali-app-tests.ts"
],
"exclude": [
".prettierrc"
]
}
+7
View File
@@ -0,0 +1,7 @@
{
"extends": "dtslint/dt.json",
"rules": {
"no-mergeable-namespace": false,
"no-unnecessary-generics": false
}
}
+1
View File
@@ -340,6 +340,7 @@ declare module 'angular' {
interface IMenuService {
hide(response?: any, options?: any): IPromise<any>;
open(event?: MouseEvent): void;
}
interface IColorPalette {
@@ -1,5 +1,5 @@
angular.module('promise-tracker-tests', []).run(['$q', 'promiseTracker',
($q: angular.IQService, promiseTracker: angular.promisetracker.PromiseTrackerService) => {
angular.module('promise-tracker-tests', []).run(['$q', '$http', 'promiseTracker',
($q: angular.IQService, $http: angular.IHttpService, promiseTracker: angular.promisetracker.PromiseTrackerService) => {
const trackerWithoutOptions = promiseTracker();
const options = {
@@ -19,4 +19,8 @@ angular.module('promise-tracker-tests', []).run(['$q', 'promiseTracker',
const addedPromise: angular.IDeferred<void> = trackerWithOptions.addPromise(promiseToAdd);
const trackerWithSomeOptions = promiseTracker({activationDelay: 500});
$http.post('/foo', {}, { });
$http.post('/foo', {}, { tracker: trackerWithOptions });
$http.post('/foo', {}, { tracker: [trackerWithoutOptions, trackerWithOptions] });
}]);
+4
View File
@@ -28,4 +28,8 @@ declare module 'angular' {
(options?: PromiseTrackerOptions): PromiseTracker;
}
}
interface IRequestShortcutConfig {
tracker?: angular.promisetracker.PromiseTracker | angular.promisetracker.PromiseTracker[];
}
}
+1 -1
View File
@@ -2,7 +2,7 @@
// Project: https://github.com/mgonto/angular-wizard
// Definitions by: Marko Jurisic <https://github.com/mjurisic>, Ronald Wildenberg <https://github.com/rwwilden>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
// TypeScript Version: 2.8
import * as angular from 'angular';
+6 -6
View File
@@ -4,7 +4,7 @@
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.4
type FunctionBasedParamter = (element: HTMLElement, index: number, length: number) => number;
type FunctionBasedParameter = (element: HTMLElement, index: number, length: number) => number;
type AnimeCallbackFunction = (anim: anime.AnimeInstance) => void;
// Allowing null is necessary because DOM queries may not return anything.
type AnimeTarget = string | object | HTMLElement | SVGElement | NodeList | null;
@@ -55,10 +55,10 @@ declare namespace anime {
interface AnimeAnimParams {
targets: AnimeTarget | ReadonlyArray<AnimeTarget>;
duration?: number | FunctionBasedParamter;
delay?: number | FunctionBasedParamter;
elasticity?: number | FunctionBasedParamter;
round?: number | boolean | FunctionBasedParamter;
duration?: number | FunctionBasedParameter;
delay?: number | FunctionBasedParameter;
elasticity?: number | FunctionBasedParameter;
round?: number | boolean | FunctionBasedParameter;
easing?: EasingOptions | string | ReadonlyArray<number>;
@@ -106,7 +106,7 @@ declare namespace anime {
}
interface AnimeTimelineAnimParams extends AnimeAnimParams {
offset: number | string | FunctionBasedParamter;
offset: number | string | FunctionBasedParameter;
}
interface AnimeTimelineInstance extends AnimeInstance {
+9 -1
View File
@@ -20,5 +20,13 @@ Object.keys({
, brightCyan: 96
, brightWhite: 97
}).forEach((color) => {
cursor[color]().bold().write(`Hello, bold ${color.replace(/([a-z])([A-Z])/g, (_: string, l: string, u: string): string => `${l} ${u.toLowerCase()}`)} world!\n`).reset();
const cname = color.replace(/([a-z])([A-Z])/g, (_: string, l: string, u: string): string => `${l} ${u.toLowerCase()}`);
((<(...anything: any[]) => ansi.Cursor> cursor[color])()
.bold()
.bg)[color === 'blue' || color === 'brightBlue' ? 'black' : 'blue']()
.write(
`Hello, bold ${cname} world!\n`
)
.reset();
});
+16 -3
View File
@@ -2,6 +2,7 @@
// Project: https://www.npmjs.com/package/ansi
// Definitions by: Gustavo6046 <https://github.com/Gustavo6046>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.1
/**
* References:
@@ -14,11 +15,19 @@
/// <reference types="node" />
import { Stream } from "stream";
declare function ansi(stream: Stream, options?: any): ansi.Cursor;
interface CursorOptions {
enabled: boolean;
buffering: boolean;
}
declare function ansi(stream: Stream, options?: CursorOptions): ansi.Cursor;
declare namespace ansi {
class Cursor {
constructor(stream: Stream, options?: any);
bg: Colorer;
fg: Colorer;
constructor(stream: Stream, options?: CursorOptions);
/**
* Helper function that calls `write()` on the underlying Stream.
@@ -161,7 +170,11 @@ declare namespace ansi {
}
interface Cursor {
[key: string]: (...anything: any[]) => Cursor;
[key: string]: ((...anything: any[]) => Cursor) | Colorer;
}
interface Colorer {
[key: string]: (...anything: any[]) => (Cursor | Colorer);
}
}
+1 -1
View File
@@ -12,7 +12,7 @@ type FontFamily =
| BaseCSSProperties['fontFamily']
| CSS.FontFace;
type Omit<T, K extends keyof T> = Pick<T, ({ [P in keyof T]: P } & { [P in K]: never } & { [x: string]: never, [x: number]: never })[keyof T]>;
type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
type CSSProperties = Omit<BaseCSSProperties, 'fontFamily' | 'transition' | 'animationName' > & {
fontFamily?: FontFamily | FontFamily[];
+3
View File
@@ -145,6 +145,9 @@ declare namespace apostrophe {
required?: boolean;
options?: AposObject;
choices?: SelectChoice[];
widgetType?: string;
titleField?: string;
schema?: Field[];
}
interface SelectChoice {
+75
View File
@@ -1440,6 +1440,81 @@ declare module "@arangodb/foxx/router" {
export = createRouter;
}
declare module "@arangodb/foxx/queues" {
interface QueueItem {
name: string;
mount: string;
backOff?: ((failureCount: number) => number) | number;
maxFailures?: number;
schema?: Foxx.Schema;
preprocess?: (data: any) => any;
}
interface Script {
name: string;
mount: string;
}
type JobCallback = (result: any, jobData: any, job: ArangoDB.Document<Job>) => void;
interface Job {
status: string;
queue: string;
type: Script;
failures: object[];
runs: number;
data: any;
created: number;
modified: number;
delayUntil: number;
maxFailures: number;
repeatDelay: number;
repeatTimes: number;
repeatUntil: number;
success?: string;
failure?: string;
runFailures: number;
abort(): void;
}
interface JobOptions {
success?: JobCallback;
failure?: JobCallback;
delayUntil?: number | Date;
backOff?: ((failureCount: number) => number) | number;
maxFailures?: number;
repeatTimes?: number;
repeatUntil?: number | Date;
repeatDelay?: number;
}
interface Queue {
push(item: QueueItem, data: any, opts?: JobOptions): void;
get(jobId: string): ArangoDB.Document<Job>;
delete(jobId: string): boolean;
pending(script?: Script): string[];
progress(script?: Script): string[];
complete(script?: Script): string[];
failed(script?: Script): string[];
all(script?: Script): string[];
}
function createQueue(name: string, maxWorkers?: number): Queue;
function deleteQueue(name: string): boolean;
function get(name: string): Queue;
export {
createQueue as create,
deleteQueue as delete,
get,
JobOptions,
Job,
Queue,
QueueItem,
Script,
};
}
declare module "@arangodb/foxx/graphql" {
import { formatError, GraphQLSchema } from "graphql";
type GraphQLModule = object;
+193
View File
@@ -0,0 +1,193 @@
import art from 'ascii-art';
art.font('test', 'doom').toPromise();
art.font('my text', 'Doom', (rendered: string) => {
rendered.big();
});
art.font('my text', 'Doom', '', (rendered) => {
rendered.big();
});
art.artwork({
artwork: 'textfiles.com/art/st-char.asc'
}).lines(31, 45, (rendered: string) => {
// cleanup non-unix terminators
rendered = rendered.replace(/\r/g, '');
art.image({
filepath : '~/Images/earth_in_space.jpg',
alphabet : 'ultra-wide'
}).overlay(rendered, {
x: 0,
y: -1,
style: 'red+blink',
transparent: '&'
}, (_final: any) => {});
});
art.font('Ghost Wire BBS', 'Doom', (logo) => {
art.font('No place like home', 'rusted', (subtext) => {
art.table({
verticalBar : ' ',
horizontalBar : ' ',
intersection : ' ',
data: [
{name: art.style('current users', 'red'), value: '203'},
{name: 'operator', value: 'vince.vega'},
{name: 'dial-in', value: '(917)555-4202'},
]
}).lines(2, (table: any) => {
art.image({
filepath : '~/Images/starburst_red.jpg',
alphabet : 'ultra-wide'
}).lines(2, 30).overlay(logo, {
x: 0,
y: 0,
style: 'blue',
}).overlay(subtext, {
x: 19,
y: 8,
style: 'yellow',
}).overlay(table, {
x: -1,
y: -1,
style: 'green',
}, (_final: any) => {
});
});
});
});
art.image({
width : 40,
filepath : '/Images/initech.png',
alphabet : 'wide'
}).font('INITECH', 'Doom', 'cyan', (_ascii) => {
});
art.table({
data: [
{text: ' .\'ANDRE. '},
{text: ' ..THE.GIANT\'. '},
{text: '.With.Bobby."The.Brain"'},
{text: '.Heenan.'}
],
verticalBar : ' ',
horizontalBar : ' ',
intersection : ' '
}).lines(2, (table: any) => {
art.strings([
'ANDRE',
'the',
'GIANT',
'POSSE',
'7\'4"',
'520 LB'
], 'rusted', (andre: any, the: any, giant: any, posse: any, height: any, weight: any) => {
art.strings([ 'has', 'a'], 'twopoint', (has: any, a: any) => {
art.image({
filepath : '/Images/andre_has_a_posse.jpeg',
alphabet : 'ultra-wide'
}).overlay(andre, {
x: 8, y: 4,
style: 'white'
}).overlay(the, {
x: 10, y: 7,
style: 'white',
transparent : true
}).overlay(giant, {
x: 8, y: 10,
style: 'white',
transparent : true
}).overlay(has, {
x: 10, y: 14,
style: 'white'
}).overlay(a, {
x: 13, y: 17,
style: 'white'
}).overlay(posse, {
x: 5, y: 20,
style: 'bright_black',
transparent: true
}).overlay(height, {
x: 59, y: 3,
style: 'bright_black',
transparent: true
}).overlay(weight, {
x: 59, y: 8,
style: 'bright_black',
transparent: true
}).overlay(table, {
x: 6, y: -6,
style: 'bright_black',
transparent: true
}, (_final: any) => {
});
});
});
});
art.Figlet.fontPath = 'Fonts';
const image = new art.Image({
filepath: '~/Images/metropolis.jpg',
alphabet: 'variant4'
});
image.write((_err: any, _rendered: string) => {
});
art.font('Prompt', 'Basic', 'red').font('v1', 'Doom', 'magenta', (_rendered) => {
});
art.image({
width : 40,
filepath : '/Images/initech.png',
alphabet : 'wide'
}).font('INITECH', 'Doom', 'cyan', (_ascii) => {
});
art.style('my text', 'red+underline');
art.table({
width : 80,
data : [ /* ... */ ],
verticalBar : ' ',
horizontalBar : ' ',
intersection : ' ',
columns : [
{
value : 'Product',
style : 'black+gray_bg'
}, {
value : 'Maker',
style : 'white'
}, {
value : 'Location',
style : 'white'
}
]
}, (_rendered) => {
// use rendered text
});
art.table({
width : 80,
data : [ /* ... */ ],
bars : {
ul_corner: '┏',
ur_corner: '┓',
lr_corner: '┛',
ll_corner: '┗',
bottom_t: '┻',
top_t: '┳',
right_t: '┫',
left_t: '┣',
intersection: '╋',
vertical: '┃',
horizontal: '━',
},
borderColor : 'bright_white',
}, (_rendered) => {
// use rendered text
});
+43
View File
@@ -0,0 +1,43 @@
// Type definitions for ascii-art 1.4
// Project: https://github.com/khrome/ascii-art
// Definitions by: Lukas Elmer <https://github.com/lukaselmer>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
export type StyleType = (text: string, style?: string, close?: boolean) => Art;
export type FontType = ((text: string, font?: string, styleOrCallback?: string | Cb, callback?: Cb) => Art);
export type ImageType = (options: object, callback?: Cb) => Art;
export type TableType = (options: object, callback?: Cb) => Art;
export type ArtworkType = (options: object, callback?: Cb) => Art;
export type LinesType = (...options: any[]) => Art;
export type OverlayType = (...options: any[]) => Art;
export type JoinType = (...options: any[]) => Art;
export type StringsType = (...options: any[]) => Art;
export const style: StyleType;
export const font: FontType;
export const image: ImageType;
export const table: TableType;
export const artwork: ArtworkType;
export const lines: LinesType;
export const overlay: OverlayType;
export const join: JoinType;
export const strings: StringsType;
export const Figlet: any;
export const Image: any;
export interface Art {
style: StyleType;
font: FontType;
image: ImageType;
table: TableType;
artwork: ArtworkType;
lines: LinesType;
overlay: OverlayType;
join: JoinType;
working: boolean;
toPromise: (() => Promise<string>);
}
export type Cb = (result: string) => void;
+24
View File
@@ -0,0 +1,24 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"allowSyntheticDefaultImports": true,
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"ascii-art-tests.ts"
]
}
+3
View File
@@ -0,0 +1,3 @@
{
"extends": "dtslint/dt.json"
}
+23
View File
@@ -203,3 +203,26 @@ management.linkUsers('primaryId', { user_id: 'secondaryId' })
management.linkUsers('primaryId', { user_id: 'secondaryId' },
(err: Error, result: any) => {});
// Get all clients (with promise)
management.getClients()
.then((clients: auth0.Client[]) => {
console.log(clients);
})
.catch((err) => {
// Handle the error
});
//Get all clients (with callback)
management.getClients((err: Error, clients: auth0.Client[]) => {});
// Get all clients with params (with promise)
management.getClients({fields:['name','client_metadata'], include_fields:true})
.then((clients: auth0.Client[]) => {
console.log(clients);
})
.catch((err) => {
// Handle the error
});
// Get all cients with params (with callback)
management.getClients({fields:['name','client_metadata'], include_fields:true}, (err:Error, clients:auth0.Client[]) => {});
+17 -4
View File
@@ -1,6 +1,6 @@
// Type definitions for auth0 2.9.2
// Project: https://github.com/auth0/node-auth0
// Definitions by: Wilson Hobbs <https://github.com/wbhob>, Seth Westphal <https://github.com/westy92>, Amiram Korach <https://github.com/amiram>
// Definitions by: Seth Westphal <https://github.com/westy92>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
@@ -588,7 +588,19 @@ export interface ImpersonateSettingOptions {
clientId?: string;
}
export type ClientAppType = 'native' | 'spa' | 'regular_web' | 'non_interactive' | 'rms' | 'box' |
'cloudbees' | 'concur' | 'dropbox' | 'mscrm' | 'echosign' | 'egnyte' | 'newrelic' | 'office365' |
'salesforce' | 'sentry' | 'sharepoint' | 'slack' | 'springcm' | 'zendesk' | 'zoom';
export interface GetClientsOptions {
fields?: string[];
include_fields?: boolean;
page?: number;
per_page?: number;
include_totals?: boolean;
is_global?: boolean;
is_first_party?: boolean;
app_type?: ClientAppType[];
}
export class AuthenticationClient {
@@ -661,8 +673,9 @@ export class ManagementClient {
// Clients
getClients(): Promise<Client[]>;
getClients(cb: (err: Error, clients: Client[]) => void): void;
getClients(params?: GetClientsOptions): Promise<Client[]>;
getClients(cb: (err: Error, clients: Client[]) => void ): void;
getClients(params: GetClientsOptions, cb: (err: Error, clients: Client[]) => void ): void;
getClient(params: ClientParams): Promise<Client>;
getClient(params: ClientParams, cb: (err: Error, client: Client) => void): void;
+2
View File
@@ -190,6 +190,8 @@ declare namespace autobahn {
export class Connection {
constructor(options?: IConnectionOptions);
isOpen: boolean;
open(): void;
close(reason?: string, message?: string): void;
+1
View File
@@ -2,6 +2,7 @@
// Project: https://github.com/postcss/autoprefixer
// Definitions by: Armando Meziat <https://github.com/odnamrataizem>, murt <https://github.com/murt>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
import { Plugin } from "postcss";
+1
View File
@@ -46,6 +46,7 @@ export type PluginName =
'estree' |
'jsx' |
'flow' |
'typescript' |
'classConstructorCall' |
'doExpressions' |
'objectRestSpread' |
@@ -0,0 +1,38 @@
import 'bootstrap-toggle';
const $elem = $("#toggle");
// Test Initialise Cases
$elem.bootstrapToggle();
$elem.bootstrapToggle({});
$elem.bootstrapToggle({
// Defaults from source project
on: 'On',
off: 'Off',
onstyle: 'primary',
offstyle: 'default',
size: 'normal',
style: '',
width: null,
height: null
});
$elem.bootstrapToggle({
width: 100,
height: 100
});
$elem.bootstrapToggle({
width: "100%",
height: "100%"
});
// Methods
$elem.bootstrapToggle("destroy");
$elem.bootstrapToggle("on");
$elem.bootstrapToggle("off");
$elem.bootstrapToggle("toggle");
$elem.bootstrapToggle("enable");
$elem.bootstrapToggle("disable");
+23
View File
@@ -0,0 +1,23 @@
// Type definitions for bootstrap-toggle 2.2
// Project: https://github.com/minhur/bootstrap-toggle
// Definitions by: Mitchell Grice <https://github.com/gricey432>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
/// <reference types="jquery"/>
interface BootstrapToggleOptions {
on?: string;
off?: string;
size?: string;
onstyle?: string;
offstyle?: string;
style?: string;
width?: number | string | null;
height?: number | string | null;
}
interface JQuery {
bootstrapToggle(options?: BootstrapToggleOptions): JQuery;
bootstrapToggle(command: "destroy" | "on" | "off" | "toggle" | "enable" | "disable"): JQuery;
}
+24
View File
@@ -0,0 +1,24 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6",
"dom"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"bootstrap-toggle-tests.ts"
]
}
+4
View File
@@ -67,6 +67,10 @@ function test_disabled() {
expect($('#foo')).to.be.disabled;
}
function test_enabled() {
expect($('#foo')).to.be.enabled;
}
function test_empty() {
$('.empty').should.be.empty;
expect($('body')).not.to.be.empty;
+1
View File
@@ -25,6 +25,7 @@ declare namespace Chai {
selected(): Assertion;
checked(): Assertion;
disabled(): Assertion;
enabled(): Assertion;
(selector: string): Assertion;
}
+5
View File
@@ -0,0 +1,5 @@
import { Song, HtmlTableFormatter } from 'chordsheetjs';
const song = new Song({ key: 'value' });
const formatter = new HtmlTableFormatter();
formatter.format(song);
+372
View File
@@ -0,0 +1,372 @@
// Type definitions for chordsheetjs 2.8
// Project: https://github.com/martijnversluis/ChordSheetJS
// Definitions by: Adam Bloom <https://github.com/adamsbloom>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
/**
* Represents a chord with the corresponding (partial) lyrics
*/
export class ChordLyricsPair {
/**
* Initialises a ChordLyricsPair
* @param chords The chords
* @param lyrics The lyrics
*/
constructor(chords: string, lyrics: string);
chords: string;
lyrics: string;
/**
* Indicates whether a ChordLyricsPair should be visible in a formatted chord sheet (except for ChordPro sheets)
*/
isRenderable: () => boolean;
/**
* Returns a deep copy of the ChordLyricsPair, useful when programmatically transforming a song
*/
clone: () => ChordLyricsPair;
toString: () => string;
}
/**
* Represents a tag/directive. See https://www.chordpro.org/chordpro/ChordPro-Directives.html
*/
export class Tag {
constructor(name: string, value: string | null);
/**
* The tag full name. When the original tag used the short name, `name` will return the full name.
*/
name: string;
/**
* The tag value
*/
value: string | null;
static parse(tag: string): Tag | null;
static parseWithRegex(tag: string, regex: string): Tag | null;
/**
* The original tag name that was used to construct the tag.
*/
originalName: string;
/**
* Checks whether the tag value is a non-empty string.
*/
hasValue(): boolean;
/**
* Checks whether the tag is usually rendered inline. It currently only applies to comment tags.
*/
isRenderable(): boolean;
/**
* Checks whether the tag is either a standard meta tag or a custom meta directive (`{x_some_name}`)
*/
isMetaTag(): boolean;
/**
* Returns a clone of the tag.
*/
clone(): Tag;
toString(): string;
}
/**
* Represents a line in a chord sheet, consisting of items of type ChordLyricsPair or Tag
*/
export class Line {
constructor();
/**
* The items (ChordLyricsPair or Tag) of which the line consists
*/
items: Array<ChordLyricsPair | Tag>;
/**
* The line type, This is set by the ChordProParser when it read tags like {start_of_chorus} or {start_of_verse}
* Values can be 'verse', 'chorus' or 'none'
*/
type: 'verse' | 'chorus' | 'none';
/**
* Indicates whether the line contains any items
*/
isEmpty(): boolean;
/**
* Adds an item to the line
* @param item The item to be added
*/
addItem(item: ChordLyricsPair | Tag): void;
/**
* Indicates whether the line contains items that are renderable
*/
hasRenderableItems(): boolean;
/**
* Returns a deep copy of the line and all of its items
*/
clone(): Line;
/**
* Indicates whether the line type is 'verse'
*/
isVerse(): boolean;
/**
* Indicates whether the line type is 'chorus'
*/
isChorus(): boolean;
/**
* Indicates whether the line contains items that are renderable. Please use hasRenderableItems
* @deprecated
*/
hasContent(): boolean;
addChordLyricsPair(
chords: ChordLyricsPair | string,
lyrics: string
): ChordLyricsPair;
ensureChordLyricsPair(): void;
chords(chr: string): void;
lyrics(chr: string): void;
addTag(name: Tag | string, value: string | null): Tag;
}
/**
* Represents a paragraph of lines in a chord sheet
*/
export class Paragraph {
constructor();
/**
* The Line items of which the paragraph consists
*/
lines: Line[];
addLine(line: Line): void;
/**
* Tries to determine the common type for all lines. If the types for all lines are equal, it returns that type.
* If not, it returns 'indeterminate'.
*/
type: string;
}
/**
* Represents a song in a chord sheet. Currently a chord sheet can only have one song.
*/
export class Song {
constructor(metadata: object);
/**
* The Line items of which the song consists
*/
lines: Line[];
/**
* The Paragraph items of which the song consists
*/
paragraphs: Paragraph[];
currentLine: Line;
currentParagraph: Paragraph;
assignMetaData(metadata: object): void;
/**
* Returns the song lines, skipping the leading empty lines (empty as in not rendering any content). This is useful
* if you want to skip the "header lines": the lines that only contain meta data.
*/
bodyLines: Line[];
chords(chr: string): void;
lyrics(chr: string): void;
addLine(): Line;
setCurrentLineType(type: string): void;
flushLine(): void;
finish(): void;
addChordLyricsPair(): ChordLyricsPair;
ensureLine(): void;
addParagraph(): Paragraph;
ensureParagraph(): void;
addTag(tagContents: string): Tag;
/**
* Returns a deep clone of the song
*/
clone(): Song;
setMetaData(name: string, value: string): void;
metaData: object;
optimizedMetaData: object;
getOptimizedMetaData(): object;
optimizeMetaDataValue(
valueSet: string[] | undefined
): string | string[] | null;
getMetaData(name: string): string | null;
}
/**
* Represents a parser warning, currently only used by ChordProParser.
*/
export class ParserWarning {
/**
* The warning message
*/
message: string;
/**
* The line number on which the warning occurred
*/
lineNumber: string;
toString(): string;
}
/**
* Parses a ChordPro chord sheet
*/
export class ChordProParser {
/**
* Parses a ChordPro chord sheet into a song
* @param chordProChordSheet The ChordPro chord sheet
*/
parse(chordProChordSheet: string): Song;
song: Song;
lineNumber: number;
sectionType: string;
warnings: ParserWarning[];
parseDocument(document: string): void;
readLyrics(chr: string): void;
readChords(chr: string): void;
readTag(chr: string): void;
readComment(chr: string): void;
finishTag(): void;
resetTag(): void;
applyTag(tag: Tag): void;
startSection(sectionType: string, tag: Tag): void;
endSection(sectionType: string, tag: Tag): void;
checkCurrentSectionType(sectionType: string, tag: Tag): void;
addWarning(message: string): void;
}
export interface ChordSheetParserProps {
preserveWhitespace: boolean;
}
/**
* Formats a song into a plain text chord sheet
*/
export class ChordSheetParser {
constructor(props: ChordSheetParserProps);
song: Song;
lines: Line[];
songLine: Line;
chordLyricsPair: ChordLyricsPair;
currentLine: number;
lineCount: number;
processingText: string;
preserveWhitespace: boolean;
/**
* Parses a chord sheet into a song
* @param chordSheet The ChordPro chord sheet
*/
parse(chordSheet: string): Song;
parseLine(line: string): void;
parseNonEmptyLine(line: string): void;
initialize(document: string): void;
readLine(): Line;
hasNextLine(): boolean;
parseLyricsWithChords(chordsLine: string, lyricsLine: string): void;
processCharacters(chordsLine: string, lyricsLine: string): void;
addCharacter(chr: string, nextChar: string): void;
shouldAddCharacterToChords(nextChar: string): boolean;
ensureChordLyricsPairInitialized(): void;
}
export interface SongHeader {
title: string;
subtitle: string;
}
export class TextFormatter {
constructor();
/**
* Formats a song into a plain text chord sheet
* @param song The song to be formatted
*/
format(song: Song): string;
formatHeader(header: SongHeader): string;
formatParagraphs(song: Song): string;
formatParagraph(paragraph: Paragraph): string;
formatLine(line: Line): string;
formatTitle(title: string): string;
formatSubtitle(subtitle: string): string;
formatTopLine(line: Line): string | null;
chordLyricsPairLength(chordLyricsPair: ChordLyricsPair): number;
formatItemTop(item: Tag | ChordLyricsPair | Line): string;
formatLineBottom(line: Line): string;
formatLineWithFormatter(
line: Line,
formatter: (x: string) => string
): string;
formatItemBottom(item: Tag | ChordLyricsPair | Line): string;
}
/**
* Formats a song into HTML. It uses TABLEs to align lyrics with chords, which makes the HTML for things like
* PDF conversion.
*/
export class HtmlTableFormatter {
constructor();
/**
* Formats a song into HTML.
* @param song The song to be formatted
*/
format(song: Song): string;
}
/**
* Formats a song into HTML. It uses DIVs to align lyrics with chords, which makes it useful for responsive web pages.
*/
export class HtmlDivFormatter {
constructor();
/**
* Formats a song into HTML.
* @param song The song to be formatted
*/
format(song: Song): string;
}
/**
* Formats a song into a ChordPro chord sheet
*/
export class ChordProFormatter {
constructor();
/**
* Formats a song into a ChordPro chord sheet.
* @param song The song to be formatted
*/
format(song: Song): string;
formatLine(line: Line): string;
formatItem(item: Tag | ChordLyricsPair | Line): string;
formatTag(tag: Tag): string;
formatChordLyricsPair(chordLyricsPair: ChordLyricsPair): string;
formatChordLyricsPairChords(chordLyricsPair: ChordLyricsPair): string;
formatChordLyricsPairLyrics(chordLyricsPair: ChordLyricsPair): string;
}
+16
View File
@@ -0,0 +1,16 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": ["es6"],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": ["../"],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": ["index.d.ts", "chordsheetjs-tests.ts"]
}
+3
View File
@@ -914,6 +914,9 @@ function test_skin() {
CKEDITOR.skin.loadPart('part', () => console.log('load'));
var path2: string = CKEDITOR.skin.path();
CKEDITOR.skin.ua_dialog = 'ie,iequirks,ie8,gecko';
CKEDITOR.skin.ua_editor = 'ie,gecko';
}
function test_style() {
+3
View File
@@ -2,6 +2,7 @@
// Project: https://ckeditor.com/ckeditor-4/
// Definitions by: Thomas Wittwer <https://github.com/wittwert>
// Stuart Long <https://github.com/stuartlong>
// Viktor Pegy <https://github.com/viktorpegy>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// WORK-IN-PROGRESS: Any contribution support welcomed.
@@ -2168,6 +2169,8 @@ declare namespace CKEDITOR {
// tslint:disable-next-line:no-duplicate-variable
var name: string;
var ua: { [name: string]: any };
var ua_dialog: string;
var ua_editor: string;
function addIcon(name: string, path: string, offset?: number, bgsize?: string): void;
function chameleon(editor: string, part: string): void;
+21
View File
@@ -230,3 +230,24 @@ table26.push(
// feel free to use colors in your content strings, column widths will be calculated correctly
const table27 = new Table({ colWidths: [5], style: { head: [], border: [] } }) as Table.HorizontalTable;
table27.push([/*colors.red(*/'hello'/*)*/]);
// Header as text
const table28 = new Table({ head: ["Top Header 1", "Top Header 2"] }) as Table.HorizontalTable;
table28.push(
['Value Row 1 Col 1', 'Value Row 1 Col 2'],
['Value Row 2 Col 1', 'Value Row 2 Col 2']
);
// Header as Cells
const table29 = new Table({ head: [{content: "Top Header 1"}, {content: "Top Header 2"}] }) as Table.HorizontalTable;
table29.push(
['Value Row 1 Col 1', 'Value Row 1 Col 2'],
['Value Row 2 Col 1', 'Value Row 2 Col 2']
);
// ColSpan in header
const table30 = new Table({ head: [{content: "Top Header 1", colSpan: 2}, {content: "Top Header 3"}] }) as Table.HorizontalTable;
table30.push(
['Value Row 1 Col 1', 'Value Row 1 Col 2', 'Value Row 1 Col 3'],
['Value Row 2 Col 1', 'Value Row 2 Col 2', 'Value Row 2 Col 3']
);
+1 -1
View File
@@ -31,7 +31,7 @@ declare namespace CliTable2 {
rowHeights: Array<number | null>;
colAligns: HorizontalAlignment[];
rowAligns: VerticalAlignment[];
head: string[];
head: Cell[];
wordWrap: boolean;
}
+20
View File
@@ -4,6 +4,7 @@
// nrbernard <https://github.com/nrbernard>
// Pr1st0n <https://github.com/Pr1st0n>
// rileymiller <https://github.com/rileymiller>
// toddself <https://github.com/toddself>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export = CodeMirror;
@@ -706,8 +707,27 @@ declare namespace CodeMirror {
or undefined if the marker is no longer in the document. */
find(): {from: CodeMirror.Position, to: CodeMirror.Position};
/** Called when you've done something that might change the size of the marker and want to cheaply update the display*/
changed(): void;
/** Returns an object representing the options for the marker. If copyWidget is given true, it will clone the value of the replacedWith option, if any. */
getOptions(copyWidget: boolean): CodeMirror.TextMarkerOptions;
/** Fired when the cursor enters the marked range */
on(eventName: 'beforeCursorEnter', handler: () => void) : void;
off(eventName: 'beforeCursorEnter', handler: () => void) : void;
/** Fired when the range is cleared, either through cursor movement in combination with clearOnEnter or through a call to its clear() method */
on(eventName: 'clear', handler: (from: Position, to: Position) => void) : void;
off(eventName: 'clear', handler: () => void) : void;
/** Fired when the last part of the marker is removed from the document by editing operations */
on(eventName: 'hide', handler: () => void) : void;
off(eventname: 'hide', handler: () => void) : void;
/** Fired when, after the marker was removed by editing, a undo operation brough the marker back */
on(eventName: 'unhide', handler: () => void) : void;
off(eventname: 'unhide', handler: () => void) : void;
}
interface LineWidget {
+12 -13
View File
@@ -4,33 +4,33 @@
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module commangular {
///////////////////////////////////////////////////////////////////////////
// Commangular Static
// see http://commangular.org/docs/#commangular-namespace
///////////////////////////////////////////////////////////////////////////
interface ICommAngularStatic {
/**
* Mock dispatch function for testing commands.
*/
dispatch( ec: ICommandCall, callback: Function ): void;
}
interface ICommandCall {
/**
* Name of the command that needs to
* execute
*/
command: string;
/**
* Data that needs to be passed to the command
*/
data?: any;
}
/**
* Object type expected to be passed into the callback function
* of the dispatch() function
@@ -41,25 +41,25 @@ declare module commangular {
* @param key The property name that is in the object that was passed
*/
dataPassed( key : string ) : any;
/**
* The data that was returned by the command
* @param key The result key that was defined in the command. If no result
* was defined use 'lastResult' as the key
*/
resultKey( key: string ): any;
/**
* Indicates if the command execution was cancelled.
*/
canceled( ): boolean;
/**
* Indicates if the command was executed????
*/
commandExecuted( ): boolean;
}
}
@@ -67,7 +67,6 @@ declare module commangular {
* Mock dispatch function for testing commands.
* @param ec an ICommandCall object
* @param callback The function that will be called upon the completion of the command
* function should expecte an ICommandInfo paramter.
* function should expecte an ICommandInfo parameter.
*/
declare function dispatch( ec: commangular.ICommandCall, callback: Function ): void;
declare function dispatch( ec: commangular.ICommandCall, callback: Function ): void;
@@ -0,0 +1,30 @@
import React = require('react');
import enzyme = require('enzyme');
import configureExtensions = require('@commercetools/enzyme-extensions');
configureExtensions(enzyme.ShallowWrapper);
function App() {
return <Child cb={() => 'Hello world'} />;
}
interface ChildProps {
cb: () => string;
}
function Child(props: ChildProps) {
return <div>{props.cb()}</div>;
}
enzyme.shallow(<App />)
.find(App)
.renderProp('render');
enzyme.shallow(<App />)
.find(Child)
.renderProp('render', 1, 2);
enzyme.shallow(<App />)
.find(Child)
.drill(props => props.cb());
enzyme.shallow(<App />).until(Child);
+22
View File
@@ -0,0 +1,22 @@
// Type definitions for @commercetools/enzyme-extensions 3.0
// Project: https://github.com/commercetools/enzyme-extensions
// Definitions by: Christian Rackerseder <https://github.com/screendriver>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
import * as enzyme from 'enzyme';
declare module 'enzyme' {
interface UntilOptions {
maxDepth: number;
}
interface ShallowWrapper<P = {}> {
renderProp(propName: string, ...args: any[]): ShallowWrapper<P>;
drill(expander: (props: any) => ShallowWrapper): ShallowWrapper<P>;
until(selector: EnzymeSelector, options?: UntilOptions): ShallowWrapper<P>;
}
}
declare function monkeyPatchShallowWrapper(s: typeof enzyme.ShallowWrapper): void;
export = monkeyPatchShallowWrapper;
@@ -0,0 +1,27 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true,
"jsx": "react",
"paths": {
"@commercetools/enzyme-extensions": ["commercetools__enzyme-extensions"]
}
},
"files": [
"index.d.ts",
"commercetools__enzyme-extensions-tests.tsx"
]
}
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }
+1
View File
@@ -625,6 +625,7 @@ declare namespace Consul {
dc?: string;
tag?: string;
passing?: boolean;
near?: string;
}
interface StateOptions extends CommonOptions {
@@ -0,0 +1,63 @@
let BluetoothClassicSerial: BluetoothClassicSerial =
window.BluetoothClassicSerial;
BluetoothClassicSerial.connect(
"",
[""]
);
BluetoothClassicSerial.connect(
"",
[""],
results => {}
);
BluetoothClassicSerial.connect(
"",
[""],
results => {},
error => {}
);
BluetoothClassicSerial.connectInsecure("", [""]);
BluetoothClassicSerial.connectInsecure("", [""], results => {});
BluetoothClassicSerial.connectInsecure("", [""], results => {}, error => {});
BluetoothClassicSerial.register(() => {});
BluetoothClassicSerial.disconnect(results => {});
BluetoothClassicSerial.disconnect(results => {}, error => {});
BluetoothClassicSerial.write("", "");
BluetoothClassicSerial.write("", "", results => {});
BluetoothClassicSerial.write("", "", results => {}, error => {});
BluetoothClassicSerial.available("");
BluetoothClassicSerial.available("", results => {});
BluetoothClassicSerial.available("", results => {}, error => {});
BluetoothClassicSerial.read("");
BluetoothClassicSerial.read("", results => {});
BluetoothClassicSerial.read("", results => {}, error => {});
BluetoothClassicSerial.readUntil("", "");
BluetoothClassicSerial.readUntil("", "", results => {});
BluetoothClassicSerial.readUntil("", "", results => {}, error => {});
BluetoothClassicSerial.subscribe("", "");
BluetoothClassicSerial.subscribe("", "", results => {});
BluetoothClassicSerial.subscribe("", "", results => {}, error => {});
BluetoothClassicSerial.unsubscribe("");
BluetoothClassicSerial.unsubscribe("", results => {});
BluetoothClassicSerial.unsubscribe("", results => {}, error => {});
BluetoothClassicSerial.subscribeRawData("");
BluetoothClassicSerial.subscribeRawData("", results => {});
BluetoothClassicSerial.subscribeRawData("", results => {}, error => {});
BluetoothClassicSerial.unsubscribeRawData("");
BluetoothClassicSerial.unsubscribeRawData("", results => {});
BluetoothClassicSerial.unsubscribeRawData("", results => {}, error => {});
BluetoothClassicSerial.clear("");
BluetoothClassicSerial.clear("", results => {});
BluetoothClassicSerial.clear("", results => {}, error => {});
BluetoothClassicSerial.list(results => {});
BluetoothClassicSerial.list(results => {}, error => {});
BluetoothClassicSerial.isConnected(results => {});
BluetoothClassicSerial.isConnected(results => {}, error => {});
BluetoothClassicSerial.isEnabled(results => {});
BluetoothClassicSerial.isEnabled(results => {}, error => {});
BluetoothClassicSerial.showBluetoothSettings(results => {});
BluetoothClassicSerial.showBluetoothSettings(results => {}, error => {});
BluetoothClassicSerial.enable(results => {});
BluetoothClassicSerial.enable(results => {}, error => {});
BluetoothClassicSerial.discoverUnpaired(results => {});
BluetoothClassicSerial.discoverUnpaired(results => {}, error => {});
+105
View File
@@ -0,0 +1,105 @@
// Type definitions for cordova-plugin-bluetoothClassic-serial 0.9
// Project: https://github.com/soltius/BluetoothClassicSerial
// Definitions by: Wouter Roosendaal <https://github.com/tuvokki>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/**
* Global object bluetoothClassicSerial.
*/
interface Window {
BluetoothClassicSerial: BluetoothClassicSerial;
}
interface BluetoothClassicSerial {
connect: (
deviceId: string,
interfaceArray: [any],
success_cb?: (results: any) => any,
fail_cb?: (error: any) => any
) => void;
connectInsecure: (
deviceId: string,
interfaceArray: [any],
success_cb?: (results: any) => any,
fail_cb?: (error: any) => any
) => void;
register: (data_cb?: () => any) => void;
disconnect: (
success_cb?: (results: any) => any,
fail_cb?: (error: any) => any
) => void;
write: (
interfaceId: string,
data: string,
success_cb?: (results: any) => any,
fail_cb?: (error: any) => any
) => void;
available: (
interfaceId: string,
success_cb?: (results: any) => any,
fail_cb?: (error: any) => any
) => void;
read: (
interfaceId: string,
success_cb?: (results: any) => any,
fail_cb?: (error: any) => any
) => void;
readUntil: (
interfaceId: string,
delimiter: string,
success_cb?: (results: any) => any,
fail_cb?: (error: any) => any
) => void;
subscribe: (
interfaceId: string,
delimiter: string,
success_cb?: (results: any) => any,
fail_cb?: (error: any) => any
) => void;
unsubscribe: (
interfaceId: string,
success_cb?: (results: any) => any,
fail_cb?: (error: any) => any
) => void;
subscribeRawData: (
interfaceId: string,
success_cb?: (results: any) => any,
fail_cb?: (error: any) => any
) => void;
unsubscribeRawData: (
interfaceId: string,
success_cb?: (results: any) => any,
fail_cb?: (error: any) => any
) => void;
clear: (
interfaceId: string,
success_cb?: (results: any) => any,
fail_cb?: (error: any) => any
) => void;
list: (
success_cb?: (results: any) => any,
fail_cb?: (error: any) => any
) => void;
isConnected: (
success_cb?: (results: any) => any,
fail_cb?: (error: any) => any
) => void;
isEnabled: (
success_cb?: (results: any) => any,
fail_cb?: (error: any) => any
) => void;
showBluetoothSettings: (
success_cb?: (results: any) => any,
fail_cb?: (error: any) => any
) => void;
enable: (
success_cb?: (results: any) => any,
fail_cb?: (error: any) => any
) => void;
discoverUnpaired: (
success_cb?: (results: any) => any,
fail_cb?: (error: any) => any
) => void;
}
declare var bluetoothClassicSerial: BluetoothClassicSerial;
@@ -0,0 +1,24 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6",
"dom"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"cordova-plugin-bluetoothclassic-serial-tests.ts"
]
}
@@ -0,0 +1,3 @@
{
"extends": "dtslint/dt.json"
}
+3
View File
@@ -0,0 +1,3 @@
import crpc from 'crpc';
const client = crpc('https://example.com/');
+9
View File
@@ -0,0 +1,9 @@
// Type definitions for crpc 0.2
// Project: https://github.com/billinghamj/crpc
// Definitions by: Alexander Forbes-Reed <https://github.com/0xdeafcafe>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.9
export type Client = <TRes>(path: string, body: any, options?: {} | null) => Promise<TRes>;
export default function crpc(baseUrl: string, options?: {}): Client;
+24
View File
@@ -0,0 +1,24 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"esModuleInterop": true,
"noImplicitAny": true,
"noImplicitThis": true,
"strictFunctionTypes": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"crpc-tests.ts"
]
}
+6
View File
@@ -0,0 +1,6 @@
{
"extends": "dtslint/dt.json",
"rules": {
"no-unnecessary-generics": false
}
}
+7
View File
@@ -144,6 +144,13 @@ contDensCustom = contDensCustom.y((datum) => {
// get
const yAcc: (d: CustomDatum) => number = contDensCustom.y();
// weight(...) -----------------------------------------------------------------
contDensCustom = contDensCustom.weight((datum) => {
return 5;
});
// get
const weightAcc: (d: CustomDatum) => number = contDensCustom.weight();
// size(...) -------------------------------------------------------------------
// set with chainability
+14 -2
View File
@@ -1,10 +1,10 @@
// Type definitions for d3-contour 1.2
// Type definitions for d3-contour 1.3
// Project: https://d3js.org/d3-contour/
// Definitions by: Tom Wanzek <https://github.com/tomwanzek>, Hugues Stefanski <https://github.com/Ledragon>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
// Last module patch version validated against: 1.2.0
// Last module patch version validated against: 1.3.2
import { MultiPolygon } from 'geojson';
import { ThresholdNumberArrayGenerator, ThresholdCountGenerator } from 'd3-array';
@@ -169,6 +169,18 @@ export interface ContourDensity<Datum = [number, number]> {
*/
y(y: (d: Datum) => number): this;
/**
* Returns the current point weight accessor.
*/
weight(): (d: Datum) => number;
/**
* Sets the point weight accessor and returns the density contour estimator.
*
* @param weight A point weight accessor function.
*/
weight(weight: (d: Datum) => number): this;
/**
* Returns the current size, which defaults to [960, 500].
*/
+1 -1
View File
@@ -407,7 +407,7 @@ export type Engine = 'circo' | 'dot' | 'fdp' | 'neato' | 'osage' | 'patchwork' |
export type TypeNames = 'initEnd' | 'start' | 'layoutStart' | 'layoutEnd' | 'dataExtractEnd' |
'dataProcessPass1End' | 'dataProcessPass2End' | 'dataProcessEnd' |
'renderStart' | 'renderEnd' | 'transitionStart' | 'transitionEnd' |
'resotreEnd' | 'end' | string; // string included to allow for optional addition of a name, e.g. initEnd.foo
'restoreEnd' | 'end' | string; // string included to allow for optional addition of a name, e.g. initEnd.foo
/**
* Enum defining the valid strings that can be passed as KeyModes
+141 -95
View File
@@ -74,7 +74,8 @@ let body: d3Selection.Selection<HTMLBodyElement, BodyDatum, HTMLElement, any> =
// with Group element of type BaseType and datum of type 'any' The parent element is of type 'null' with datum of type 'undefined'
const baseTypeEl2: d3Selection.Selection<d3Selection.BaseType, any, null, undefined> = d3Selection.select(baseTypeEl.node());
// let body2: d3Selection.Selection<HTMLElement, any, null, undefined> = d3Selection.select(baseTypeEl.node()); // fails as baseTypeEl.node() is of type cannot be assigned to HTMLElement
// $ExpectError
const body2: d3Selection.Selection<HTMLElement, any, null, undefined> = d3Selection.select(baseTypeEl.node()); // fails as baseTypeEl.node() is of type cannot be assigned to HTMLElement
const body3: d3Selection.Selection<HTMLBodyElement, any, null, undefined> = d3Selection.select(body.node()!); // element types match, but datum is of type 'any' as it cannot be inferred from .node()
@@ -86,18 +87,21 @@ const body4: d3Selection.Selection<HTMLBodyElement, BodyDatum, null, undefined>
// Explicitly cast body.node() to HTMLBodyElement to narrow selection definition.
const body5: d3Selection.Selection<HTMLBodyElement, BodyDatum, null, undefined> = d3Selection.select<HTMLBodyElement, BodyDatum>(body.node()!);
// d3Selection.select<HTMLBodyElement, BodyDatum>(baseTypeEl.node()!); // fails as baseTypeEl.node() is not of type HTMLBodyElement
// $ExpectError
d3Selection.select<HTMLBodyElement, BodyDatum>(baseTypeEl.node()!); // fails as baseTypeEl.node() is not of type HTMLBodyElement
// test, when it is not certain, whether an element of the type to be selected exists
let maybeSVG1: d3Selection.Selection<SVGSVGElement | null, any, HTMLElement, undefined>;
maybeSVG1 = d3Selection.select<SVGSVGElement | null, any>('svg');
let maybeSVG2: d3Selection.Selection<SVGSVGElement | null, any, null, undefined>;
// maybeSVG2 = d3Selection.select<SVGSVGElement, any>(maybeSVG1.node()); // fails with strict function types
// $ExpectError
maybeSVG2 = d3Selection.select<SVGSVGElement, any>(maybeSVG1.node()); // fails with strict function types
maybeSVG2 = d3Selection.select<SVGSVGElement | null, any>(maybeSVG1.node());
// fails, as node type mismatches selection type
// let body7: d3Selection.Selection<HTMLBodyElement | null, any, HTMLElement, undefined> = d3Selection.select<HTMLBodyElement | null, any>(maybeSVG1.node());
// $ExpectError
const body7: d3Selection.Selection<HTMLBodyElement | null, any, HTMLElement, undefined> = d3Selection.select<HTMLBodyElement | null, any>(maybeSVG1.node());
// test "special case DOM objects"
@@ -127,7 +131,8 @@ const divElements: d3Selection.Selection<HTMLDivElement, DivDatum, HTMLElement,
const baseTypeElements2: d3Selection.Selection<d3Selection.BaseType, any, null, undefined> = d3Selection.selectAll(baseTypeElements.nodes());
// fails, group elements types not of compatible for baseTypeElements
// let divElements2: d3Selection.Selection<HTMLDivElement, any, null, undefined> = d3Selection.selectAll(baseTypeElements.nodes());
// $ExpectError
const divElements2: d3Selection.Selection<HTMLDivElement, any, null, undefined> = d3Selection.selectAll(baseTypeElements.nodes());
// element types match, but datum is of type 'any' as it cannot be inferred from .nodes()
const divElements3: d3Selection.Selection<HTMLDivElement, any, null, undefined> = d3Selection.selectAll(divElements.nodes());
@@ -137,7 +142,8 @@ const divElements3: d3Selection.Selection<HTMLDivElement, any, null, undefined>
const divElements4: d3Selection.Selection<HTMLDivElement, DivDatum, null, undefined> = d3Selection.selectAll<HTMLDivElement, DivDatum>(divElements.nodes());
// d3Selection.selectAll<HTMLDivElement, DivDatum>(baseTypeElements.nodes()); // fails as baseTypeEl.node() is not of type HTMLBodyElement
// $ExpectError
d3Selection.selectAll<HTMLDivElement, DivDatum>(baseTypeElements.nodes()); // fails as baseTypeEl.node() is not of type HTMLBodyElement
// selectAll(...) accepts NodeListOf<...> argument
@@ -161,8 +167,8 @@ const documentLinks: d3Selection.Selection<HTMLAnchorElement | HTMLAreaElement,
const svgEl: d3Selection.Selection<SVGSVGElement, SVGDatum, HTMLElement, any> = d3Selection.select<SVGSVGElement, SVGDatum>('svg');
let firstG: d3Selection.Selection<SVGGElement, SVGDatum, HTMLElement, any> = svgEl.select<SVGGElement>('g');
// let firstG_2: d3Selection.Selection<SVGGElement, SVGDatum, SVGSVGElement, any> = svgEl.select<SVGGElement>('g'); // fails, parent element of selection does not change with .select(...)
// firstG = svgEl.select('g'); // fails, element type defaults to 'BaseType', but SVGGElement expected on left-hand side
// $ExpectError
const firstG_2: d3Selection.Selection<SVGGElement, SVGDatum, SVGSVGElement, any> = svgEl.select<SVGGElement>('g'); // fails, parent element of selection does not change with .select(...)
// firstG = svgEl.select<SVGSVGElement>('svg'); // fails, element type of SVGSVGElement provided, but SVGGElement expected on left-hand side (silly test to begin with)
// test, when it is not certain, whether an element of the type to be selected exists
@@ -180,14 +186,16 @@ firstG = svgEl.select(svgGroupSelector);
firstG = svgEl.select(function() {
const that: SVGSVGElement = this;
// const that2: HTMLElement = this; // fails, type mismatch
// $ExpectError
const that2: HTMLElement = this; // fails, type mismatch
console.log('Get <svg> Element width using "this": ', this.width.baseVal.value); // 'this' type is SVGSVGElement
return this.querySelector('g')!; // this of type SVGSVGElement by type inference
});
firstG = svgEl.select(function(d, i, g) {
const that: SVGSVGElement = this;
// const that2: HTMLElement = this; // fails, type mismatch
// $ExpectError
const that2: HTMLElement = this; // fails, type mismatch
const datum: SVGDatum = d;
const index: number = i;
const group: SVGSVGElement[] | d3Selection.ArrayLike<SVGSVGElement> = g;
@@ -199,9 +207,10 @@ firstG = svgEl.select(function(d, i, g) {
return this.querySelector('g')!; // this of type SVGSVGElement by type inference
});
// firstG = svgEl.select(function() {
// return this.querySelector('a'); // fails, return type HTMLAnchorElement is not compatible with SVGGElement expected by firstG
// });
// $ExpectError
firstG = svgEl.select(function() {
return this.querySelector('a'); // fails, return type HTMLAnchorElement is not compatible with SVGGElement expected by firstG
});
// selectAll(...) sub-selection --------------------------------------------------------------
@@ -219,7 +228,6 @@ emptySubSelection = svgEl.selectAll(undefined);
let elementsUnknownData: d3Selection.Selection<SVGGElement, any, SVGSVGElement, SVGDatum> = svgEl.selectAll<SVGGElement, any>('g');
// let elementsAndDataUnknown: d3Selection.Selection<d3Selection.BaseType, any, SVGSVGElement, SVGDatum> = svgEl.selectAll('g'); // fails with strictFunctionTypes
let gElementsOldData: d3Selection.Selection<SVGGElement, CircleDatum, SVGSVGElement, SVGDatum> = svgEl.selectAll<SVGGElement, CircleDatum>('g');
// gElementsOldData = svgEl.selectAll('g'); // fails default type parameters of selectAll for group element type and datum type do not match
// Using selectAll(...) sub-selection with a selector function argument.
@@ -232,18 +240,21 @@ gElementsOldData = svgEl.selectAll<SVGGElement, CircleDatum>(svgGroupSelectorAll
function wrongSvgGroupSelectorAll(this: HTMLElement, d: SVGDatum, i: number, groups: HTMLElement[]): NodeListOf<SVGGElement> {
return this.querySelectorAll('g');
}
// gElementsOldData = svgEl.selectAll<SVGGElement, CircleDatum>(wrongSvgGroupSelectorAll); // fails, wrong this context
// $ExpectError
gElementsOldData = svgEl.selectAll<SVGGElement, CircleDatum>(wrongSvgGroupSelectorAll); // fails, wrong this context
gElementsOldData = svgEl.selectAll<SVGGElement, CircleDatum>(function() {
const that: SVGSVGElement = this;
// const that2: HTMLElement = this; // fails, type mismatch
// $ExpectError
const that2: HTMLElement = this; // fails, type mismatch
console.log('Get <svg> Element width using "this": ', this.width.baseVal.value); // 'this' type is SVGSVGElement
return this.querySelectorAll('g'); // this of type SVGSVGElement by type inference
});
gElementsOldData = svgEl.selectAll<SVGGElement, CircleDatum>(function(d, i, g) {
const that: SVGSVGElement = this;
// const that2: HTMLElement = this; // fails, type mismatch
// $ExpectError
const that2: HTMLElement = this; // fails, type mismatch
const datum: SVGDatum = d;
const index: number = i;
const group: SVGSVGElement[] | d3Selection.ArrayLike<SVGSVGElement> = g;
@@ -255,31 +266,32 @@ gElementsOldData = svgEl.selectAll<SVGGElement, CircleDatum>(function(d, i, g) {
return this.querySelectorAll('g');
});
// gElementsOldData = svgEl.selectAll(function() { // fails, because Datum type is not compatible as selectAll defaults to 'any', but gElementsOldData expects CircleDatum
// return this.querySelectorAll('g');
// });
// gElementsOldData = svgEl.selectAll<SVGGElement, CircleDatum>(function() { // fails, return type HTMLAnchorElement is not compatible with SVGGElement expected by selectAll-typing
// return this.querySelectorAll('a');
// });
// $ExpectError
gElementsOldData = svgEl.selectAll<SVGGElement, CircleDatum>(function() { // fails, return type HTMLAnchorElement is not compatible with SVGGElement expected by selectAll-typing
return this.querySelectorAll('a');
});
elementsUnknownData = svgEl.selectAll(svgGroupSelectorAll);
elementsUnknownData = svgEl.selectAll(function() {
const that: SVGSVGElement = this;
// const that2: HTMLElement = this; // fails, type mismatch
// $ExpectError
const that2: HTMLElement = this; // fails, type mismatch
console.log('Get <svg> Element width using "this": ', this.width.baseVal.value); // 'this' type is SVGSVGElement
return this.querySelectorAll('g'); // this of type SVGSVGElement by type inference
});
// gElementsUnknownData = svgEl.selectAll(function() { // fails, return type HTMLAnchorElement is not compatible with SVGGElement
// return this.querySelectorAll('a');
// });
// $ExpectError
gElementsUnknownData = svgEl.selectAll(function() { // fails, return type HTMLAnchorElement is not compatible with SVGGElement
return this.querySelectorAll('a');
});
maybeG.selectAll(function(d, i, g) {
const that: SVGGElement | null = this;
// const that2: SVGGElement = this; // fails with strictNullChecks
// const that3: HTMLElement | null = this; // fails, type mismatch
// $ExpectError
const that2: SVGGElement = this; // fails with strictNullChecks
// $ExpectError
const that3: HTMLElement | null = this; // fails, type mismatch
const datum: SVGDatum = d;
const index: number = i;
const group: Array<SVGGElement | null> | d3Selection.ArrayLike<SVGGElement | null> = g;
@@ -290,11 +302,13 @@ maybeG.selectAll(function(d, i, g) {
// selector(...) and selectorAll(...) ----------------------------------------------------
// d3Selection.select<SVGGElement>(d3Selection.selector<SVGGElement>('g')); // fails, selector as argument to top-level select not supported
// $ExpectError
d3Selection.select<SVGGElement>(d3Selection.selector<SVGGElement>('g')); // fails, selector as argument to top-level select not supported
// supported on sub-selection
firstG = svgEl.select(d3Selection.selector<SVGGElement>('g')); // type parameter of select(...) inferred
// firstG = svgEl.select<SVGGElement>(d3Selection.selector<HTMLDivElement>('div')); // fails, select and selector mismatch
// $ExpectError
firstG = svgEl.select<SVGGElement>(d3Selection.selector<HTMLDivElement>('div')); // fails, select and selector mismatch
gElementsOldData = svgEl.selectAll<SVGGElement, CircleDatum>(d3Selection.selectorAll<SVGGElement>('g'));
@@ -308,7 +322,8 @@ filteredGElements = gElementsOldData.filter('.top-level');
filteredGElements = gElementsOldData.filter(function(d, i, g) {
const that: SVGGElement = this;
// const that2: HTMLElement = this; // fails, type mismatch
// $ExpectError
const that2: HTMLElement = this; // fails, type mismatch
const datum: CircleDatum = d;
const index: number = i;
const group: SVGGElement[] | d3Selection.ArrayLike<SVGGElement> = g;
@@ -325,16 +340,18 @@ filteredGElements = gElementsOldData.filter(function(d, i, g) {
let filteredGElements2: d3Selection.Selection<SVGGElement, any, HTMLElement, any>;
filteredGElements2 = d3Selection.selectAll<SVGElement, any>('.any-svg-type').filter<SVGGElement>('g');
// filteredGElements2 = d3Selection.selectAll('.any-type').filter('g'); // fails without using narrowing generic on filter method
// $ExpectError
filteredGElements2 = d3Selection.selectAll('.any-type').filter('g'); // fails without using narrowing generic on filter method
filteredGElements2 = d3Selection.selectAll<SVGElement, any>('.any-svg-type').filter<SVGGElement>(function() {
const that: SVGElement = this;
return that.tagName === 'g' || that.tagName === 'G';
});
// filteredGElements2 = d3Selection.selectAll<SVGElement, any>('.any-svg-type').filter(function(){
// const that: SVGElement = this;
// return that.tagName === 'g'|| that.tagName === 'G';
// }); // fails without using narrowing generic on filter method
// $ExpectError
filteredGElements2 = d3Selection.selectAll<SVGElement, any>('.any-svg-type').filter(function() {
const that: SVGElement = this;
return that.tagName === 'g' || that.tagName === 'G';
}); // fails without using narrowing generic on filter method
// matcher() -----------------------------------------------------------------------------
@@ -371,7 +388,8 @@ circles = d3Selection.selectAll<SVGCircleElement, CircleDatumAlternative>('circl
circles = circles // re-assignment test chaining return-type
.attr('cx', function(d, i, g) {
const that: SVGGElement = this;
// const that2: HTMLElement = this; // fails, type mismatch
// $ExpectError
const that2: HTMLElement = this; // fails, type mismatch
const datum: CircleDatum = d;
const index: number = i;
const group: SVGGElement[] | d3Selection.ArrayLike<SVGGElement> = g;
@@ -395,7 +413,8 @@ divs = divs
divs = divs
.classed('zero-px-padding', function(d, i, g) {
const that: HTMLDivElement = this;
// const that2: SVGElement = this; // fails, type mismatch
// $ExpectError
const that2: SVGElement = this; // fails, type mismatch
const datum: DivDatum = d;
const index: number = i;
const group: HTMLDivElement[] | d3Selection.ArrayLike<HTMLDivElement> = g;
@@ -411,13 +430,15 @@ divs = divs
divs = divs
.style('background-color', 'blue') // string
.style('hidden', false) // boolean
// .style('color', 'green', 'test') // fails, invalid priority value
// $ExpectError
.style('color', 'green', 'test') // fails, invalid priority value
.style('color', 'green', 'important');
divs = divs
.style('padding', function(d, i, g) {
const that: HTMLDivElement = this;
// const that2: SVGElement = this; // fails, type mismatch
// $ExpectError
const that2: SVGElement = this; // fails, type mismatch
const datum: DivDatum = d;
const index: number = i;
const group: HTMLDivElement[] | d3Selection.ArrayLike<HTMLDivElement> = g;
@@ -428,7 +449,8 @@ divs = divs
return d.padding; // string return value
})
.style('hidden', () => true, null) // boolean return + test: priority = null
// .style('color', function() { return 'green'; }, 'test') // fails, test: invalid priority value
// $ExpectError
.style('color', () => 'green', 'test') // fails, test: invalid priority value
.style('color', () => 'green', 'important'); // boolean return + test: priority = 'important';
// property(...) Tests
@@ -442,7 +464,8 @@ circles = circles
circles = circles
.property('__hitchhikersguide__', function(d, i, g) {
const that: SVGCircleElement = this;
// const that2: HTMLElement = this; // fails, type mismatch
// $ExpectError
const that2: HTMLElement = this; // fails, type mismatch
const datum: CircleDatumAlternative = d;
const index: number = i;
const group: SVGCircleElement[] | d3Selection.ArrayLike<SVGCircleElement> = g;
@@ -466,7 +489,8 @@ body = body
body = body
.text(function(d, i, g) {
const that: HTMLBodyElement = this;
// const that2: SVGElement = this; // fails, type mismatch
// $ExpectError
const that2: SVGElement = this; // fails, type mismatch
const datum: BodyDatum = d;
const index: number = i;
const group: HTMLBodyElement[] | d3Selection.ArrayLike<HTMLBodyElement> = g;
@@ -482,7 +506,8 @@ body = body
body = body
.html(function(d, i, g) {
const that: HTMLBodyElement = this;
// const that2: SVGElement = this; // fails, type mismatch
// $ExpectError
const that2: SVGElement = this; // fails, type mismatch
const datum: BodyDatum = d;
const index: number = i;
const group: HTMLBodyElement[] | d3Selection.ArrayLike<HTMLBodyElement> = g;
@@ -521,13 +546,15 @@ let newBodyDatum: { newFoo: string };
newBodyDatum = body.datum({ newFoo: 'new foo' }).datum(); // inferred type
// body.datum<BodyDatum>({ newFoo: 'new foo' }); // fails, data type incompatible
// $ExpectError
body.datum<BodyDatum>({ newFoo: 'new foo' }); // fails, data type incompatible
// function-based
newBodyDatum = body.datum(function(d, i, g) {
const that: HTMLBodyElement = this;
// const that2: SVGElement = this; // fails, type mismatch
// $ExpectError
const that2: SVGElement = this; // fails, type mismatch
const datum: BodyDatum = d;
const index: number = i;
const group: HTMLBodyElement[] | d3Selection.ArrayLike<HTMLBodyElement> = g;
@@ -536,10 +563,11 @@ newBodyDatum = body.datum(function(d, i, g) {
return { newFoo: 'new foo' };
}).datum(); // inferred type
// newBodyDatum = body.datum<BodyDatum>(function(d) { // fails, data type incompatible with return value type
// console.log('HTML5 Custom Data Attributes of body: ', this.dataset); // this typings HTMLBodyElement
// return { newFoo: 'new foo' };
// }).datum(); // inferred type
// $ExpectError
newBodyDatum = body.datum<BodyDatum>(function(d) { // fails, data type incompatible with return value type
console.log('HTML5 Custom Data Attributes of body: ', this.dataset); // this typings HTMLBodyElement
return { newFoo: 'new foo' };
}).datum(); // inferred type
// SCENARIO 1: Fully type-parameterized
@@ -560,7 +588,8 @@ d3Selection.select('#svg-1') // irrelevant typing to get contextual typing in la
.datum(data2) // new data type inferred
.classed('has-transform-property', function(d, i, g) {
const that: SVGGElement = this;
// const that2: HTMLElement = this; // fails, type mismatch
// $ExpectError
const that2: HTMLElement = this; // fails, type mismatch
const datum: CircleDatumAlternative[] = d;
const index: number = i;
const group: SVGGElement[] | d3Selection.ArrayLike<SVGGElement> = g;
@@ -569,14 +598,14 @@ d3Selection.select('#svg-1') // irrelevant typing to get contextual typing in la
});
// below fails, as 'this' in .classed(...) will default to BaseType, which may be null and does not have 'transform' property
// d3Selection.select('#svg-1') // irrelevant typing to get contextual typing in last step of chain
// .select('g.circles-group') // missing typing of selected DOM element for use in .classed(...)
// .datum(data2) // new data type inferred
// .classed('has-transform-property', function(d) {
// console.log('Color of first data element array', d.length > 0? d[0].color: 'Data array empty'); // CircleDatumAlternative type
// return this.transform !== undefined;
// });
d3Selection.select('#svg-1') // irrelevant typing to get contextual typing in last step of chain
.select('g.circles-group') // missing typing of selected DOM element for use in .classed(...)
.datum(data2) // new data type inferred
.classed('has-transform-property', function(d) {
console.log('Color of first data element array', d.length > 0 ? d[0].color : 'Data array empty'); // CircleDatumAlternative type
// $ExpectError
return this.transform !== undefined;
});
// SCENARIO 3: Only inferred typing (To have datum-type in 'classed' method call, no need for DOM object access)
@@ -585,7 +614,8 @@ d3Selection.select('#svg-1') // irrelevant typing to get contextual typing in la
.datum(data2) // new data type inferred
.classed('has-green-first-data-element', function(d, i, g) {
const that: d3Selection.BaseType = this;
// const that2: Element = this; // fails, type mismatch
// $ExpectError
const that2: Element = this; // fails, type mismatch
const datum: CircleDatumAlternative[] = d;
const index: number = i;
const group: d3Selection.BaseType[] | d3Selection.ArrayLike<d3Selection.BaseType> = g;
@@ -663,7 +693,8 @@ circles2 = d3Selection.select<SVGSVGElement, any>('#svg2')
circles2 = circles2 // returned update selection has the same type parameters as original selection, if data type is unchanged
.data<CircleDatumAlternative>(endCircleData, d => d.nodeId);
// circles2.data<DivDatum>(endCircleData, function(d) { return d.nodeId; }); // fails, forced data type parameter and data argument mismatch
// $ExpectError
circles2.data<DivDatum>(endCircleData, (d) => d.nodeId); // fails, forced data type parameter and data argument mismatch
// ENTER-selection -----------------------------------------------------------------
@@ -690,7 +721,8 @@ const exitCircles = circles2.exit<CircleDatumAlternative>(); // Note: need to re
exitCircles
.style('opacity', function(d, i, g) {
const that: SVGCircleElement = this;
// const that2: HTMLElement = this; // fails, type mismatch
// $ExpectError
const that2: HTMLElement = this; // fails, type mismatch
const datum: CircleDatumAlternative = d;
const index: number = i;
const group: SVGCircleElement[] | d3Selection.ArrayLike<SVGCircleElement> = g;
@@ -702,12 +734,13 @@ exitCircles
// Note: the alternative using only .exit() without typing, will fail, if access to datum properties is attempted.
// If access to d is not required, the short-hand is acceptable e.g. circles2.exit().remove();
// let exitCircles2 = circles2.exit(); // Note: Without explicit re-typing to the old data type, the data type default to '{}'
// exitCircles2
// .style('opacity', function(d) {
// console.log('Circle Radius exit node: ', this.r.baseVal.value);
// return d.color === 'green' ? 1 : 0; // fails, as data type is defaulted to {}. If datum access is required, this should trigger the thought to type .exit<...>
// });
const exitCircles2 = circles2.exit(); // Note: Without explicit re-typing to the old data type, the data type default to '{}'
exitCircles2
.style('opacity', function(d) {
console.log('Circle Radius exit node: ', this.r.baseVal.value);
// $ExpectError
return d.color === 'green' ? 1 : 0; // fails, as data type is defaulted to {}. If datum access is required, this should trigger the thought to type .exit<...>
});
// MERGE ENTER + UPDATE ------------------------------------------------------------------
@@ -733,8 +766,8 @@ tr = d3Selection.select('body')
.append<HTMLTableElement>('table')
.selectAll()
.data(matrix)
// .data([{test: 1}, {test: 2}]) // fails, using this data statement instead, would fail assignment to tr due to the data type of tr Selection
// .data<number[]>([{test: 1}, {test: 2}]) // fails, using this data statement instead, would fail because of its type parameter not being met by input
// $ExpectError
.data<number[]>([{test: 1}, {test: 2}]) // fails, using this data statement instead, would fail because of its type parameter not being met by input
.enter().append<HTMLTableRowElement>('tr');
nMatrix = tr.data(); // i.e. matrix
@@ -745,7 +778,6 @@ td = tr.selectAll()
.enter().append<HTMLTableDataCellElement>('td')
.text(function(d, i, g) {
const that: HTMLTableDataCellElement = this;
// const that2: Element = this; // fails, type mismatch
const datum: number = d;
const index: number = i;
const group: HTMLTableDataCellElement[] | d3Selection.ArrayLike<HTMLTableDataCellElement> = g;
@@ -787,11 +819,13 @@ newDiv2 = body.append<HTMLDivElement>('div');
// using creator
newDiv2 = body.append(d3Selection.creator<HTMLDivElement>('div'));
// newDiv2 = body.append(d3Selection.creator('div')); // fails, as creator returns BaseType element, but HTMLDivElement is expected.
// $ExpectError
newDiv2 = body.append(d3Selection.creator('div')); // fails, as creator returns BaseType element, but HTMLDivElement is expected.
newDiv2 = body.append(function(d, i, g) {
const that: HTMLBodyElement = this;
// const that2: SVGElement = this; // fails, type mismatch
// $ExpectError
const that2: SVGElement = this; // fails, type mismatch
const datum: BodyDatum = d;
const index: number = i;
const group: HTMLBodyElement[] | d3Selection.ArrayLike<HTMLBodyElement> = g;
@@ -799,13 +833,15 @@ newDiv2 = body.append(function(d, i, g) {
return this.ownerDocument!.createElement('div'); // this-type HTMLBodyElement
});
// newDiv2 = body.append<HTMLDivElement>(function(d) {
// return this.ownerDocument.createElement('a'); // fails, HTMLDivElement expected by type parameter, HTMLAnchorElement returned
// });
// $ExpectError
newDiv2 = body.append<HTMLDivElement>(function(d) {
return this.ownerDocument!.createElement('a'); // fails, HTMLDivElement expected by type parameter, HTMLAnchorElement returned
});
// newDiv2 = body.append(function(d) {
// return this.ownerDocument.createElement('a'); // fails, HTMLDivElement expected by inference, HTMLAnchorElement returned
// });
// $ExpectError
newDiv2 = body.append(function(d) {
return this.ownerDocument!.createElement('a'); // fails, HTMLDivElement expected by inference, HTMLAnchorElement returned
});
// create a detached element
@@ -909,7 +945,8 @@ const size: number = gElementsOldData.size();
// returns 'this' selection
circles = circles.each(function(d, i, g) { // check chaining return type by re-assigning
const that: SVGCircleElement = this;
// const that2: HTMLElement = this; // fails, type mismatch
// $ExpectError
const that2: HTMLElement = this; // fails, type mismatch
const datum: CircleDatum = d;
const index: number = i;
const group: SVGCircleElement[] | d3Selection.ArrayLike<SVGCircleElement> = g;
@@ -931,13 +968,15 @@ function enforceMinRadius(selection: d3Selection.Selection<SVGCircleElement, Cir
// returns 'this' selection
circles = circles.call(enforceMinRadius, 40); // check chaining return type by re-assigning
// circles.call(function(selection: d3Selection.Selection<HTMLDivElement, CircleDatum, any, any>):void {
// // fails, group element types of selection not compatible: SVGCircleElement v HTMLDivElement
// });
// $ExpectError
circles.call((selection: d3Selection.Selection<HTMLDivElement, CircleDatum, any, any>) => {
// fails, group element types of selection not compatible: SVGCircleElement v HTMLDivElement
});
// circles.call(function(selection: d3Selection.Selection<SVGCircleElement, DivDatum, any, any>):void {
// // fails, group datum types of selection not compatible: CircleDatumAlternative v DivDatum
// });
// $ExpectError
circles.call((selection: d3Selection.Selection<SVGCircleElement, DivDatum, any, any>) => {
// fails, group datum types of selection not compatible: CircleDatumAlternative v DivDatum
});
// ---------------------------------------------------------------------------------------
// Tests of Event Handling
@@ -949,7 +988,8 @@ let listener: undefined | ((this: HTMLBodyElement, datum: BodyDatum, index: numb
body = body.on('click', function(d, i, g) {
const that: HTMLBodyElement = this;
// const that2: SVGElement = this; // fails, type mismatch
// $ExpectError
const that2: SVGElement = this; // fails, type mismatch
const datum: BodyDatum = d;
const index: number = i;
const group: HTMLBodyElement[] | d3Selection.ArrayLike<HTMLBodyElement> = g;
@@ -981,7 +1021,8 @@ body = body.dispatch('fooEvent', fooEventParam); // re-assign for chaining test;
body = body.dispatch('fooEvent', function(d, i, g) { // re-assign for chaining test;
const that: HTMLBodyElement = this;
// const that2: SVGElement = this; // fails, type mismatch
// $ExpectError
const that2: SVGElement = this; // fails, type mismatch
const datum: BodyDatum = d;
const index: number = i;
const group: HTMLBodyElement[] | d3Selection.ArrayLike<HTMLBodyElement> = g;
@@ -1016,11 +1057,16 @@ function customListener(this: HTMLBodyElement | null, finalOpponent: string): st
const resultText: string = d3Selection.customEvent(successEvent, customListener, body.node(), 'Wales');
// let result = d3Selection.customEvent(successEvent, customListener, circles.nodes()[0], 'Wales'); // fails, incompatible 'this' context in call
// let resultValue: number = d3Selection.customEvent(successEvent, customListener, body.node(), 'Wales'); // fails, incompatible return types
// d3Selection.customEvent<SVGCircleElement, any>(successEvent, customListener, circles.nodes()[0], 'Wales'); // fails, incompatible 'this' context in type parameter and call
// d3Selection.customEvent<HTMLBodyElement, any>(successEvent, customListener, circles.nodes()[0], 'Wales'); // fails, incompatible 'this' context in type parameter and call
// d3Selection.customEvent<HTMLBodyElement, number>(successEvent, customListener, body.node(), 'Wales'); // fails, incompatible return types
// $ExpectError
const result = d3Selection.customEvent(successEvent, customListener, circles.nodes()[0], 'Wales'); // fails, incompatible 'this' context in call
// $ExpectError
const resultValue: number = d3Selection.customEvent(successEvent, customListener, body.node(), 'Wales'); // fails, incompatible return types
// $ExpectError
d3Selection.customEvent<SVGCircleElement, any>(successEvent, customListener, circles.nodes()[0], 'Wales'); // fails, incompatible 'this' context in type parameter and call
// $ExpectError
d3Selection.customEvent<HTMLBodyElement, any>(successEvent, customListener, circles.nodes()[0], 'Wales'); // fails, incompatible 'this' context in type parameter and call
// $ExpectError
d3Selection.customEvent<HTMLBodyElement, number>(successEvent, customListener, body.node(), 'Wales'); // fails, incompatible return types
// mouse() ---------------------------------------------------------------------------------
+4 -1
View File
@@ -1,6 +1,9 @@
// Type definitions for D3JS d3-selection module 1.3
// Project: https://github.com/d3/d3-selection/
// Definitions by: Tom Wanzek <https://github.com/tomwanzek>, Alex Ford <https://github.com/gustavderdrache>, Boris Yankov <https://github.com/borisyankov>
// Definitions by: Tom Wanzek <https://github.com/tomwanzek>
// Alex Ford <https://github.com/gustavderdrache>
// Boris Yankov <https://github.com/borisyankov>
// denisname <https://github.com/denisname>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// Last module patch version validated against: 1.3.0
+4
View File
@@ -7,6 +7,10 @@
import { Path } from 'd3-path';
declare global {
interface CanvasRenderingContext2D {} // tslint:disable-line no-empty-interface
}
// -----------------------------------------------------------------------------------
// Shared Types and Interfaces
// -----------------------------------------------------------------------------------
+1
View File
@@ -9,6 +9,7 @@ tracer.init({
debug: msg => {},
error: err => {},
},
tags: { tracerEnv: 'dev'}
});
function useWebFrameworkPlugin(plugin: "express" | "hapi" | "koa" | "restify") {
+5
View File
@@ -110,6 +110,11 @@ interface TracerOptions {
debug: (message: string) => void;
error: (err: Error) => void;
};
/**
* Global tags that should be assigned to every span.
*/
tags?: { [key: string]: any };
}
interface ExperimentalOptions {}
+7 -14
View File
@@ -1,9 +1,6 @@
import { diff, observableDiff, applyChange, Diff } from 'deep-diff';
import _deepDiff = require('deep-diff');
var diff = _deepDiff.diff;
var lhs = {
let lhs = {
name: 'my object',
description: 'it\'s an object!',
details: {
@@ -13,7 +10,7 @@ var lhs = {
}
};
var rhs = {
let rhs = {
name: 'updated object',
description: 'it\'s an object!',
details: {
@@ -23,17 +20,13 @@ var rhs = {
}
};
var differences: deepDiff.IDiff[] = diff(lhs, rhs);
const differences: Array<Diff<any>> = diff(lhs, rhs);
console.log(differences);
// --------------------------
var observableDiff = _deepDiff.observableDiff;
var applyChange = _deepDiff.applyChange;
var lhs = {
lhs = {
name: 'my object',
description: 'it\'s an object!',
details: {
@@ -43,7 +36,7 @@ var lhs = {
}
};
var rhs = {
rhs = {
name: 'updated object',
description: 'it\'s an object!',
details: {
@@ -53,7 +46,7 @@ var rhs = {
}
};
observableDiff(lhs, rhs, function (d: deepDiff.IDiff) {
observableDiff(lhs, rhs, d => {
// Apply all changes except those to the 'name' property...
if (d.path.length !== 1 || d.path.join('.') !== 'name') {
applyChange(lhs, rhs, d);
+53 -35
View File
@@ -1,42 +1,60 @@
// Type definitions for deep-diff
// Type definitions for deep-diff 1.0
// Project: https://github.com/flitbit/diff/
// Definitions by: ZauberNerd <https://github.com/ZauberNerd>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
declare namespace deepDiff {
interface IDiff {
kind: string;
path: string[];
lhs: any;
rhs: any;
index?: number;
item?: IDiff;
}
interface IAccumulator {
push(diff: IDiff): void;
length: number;
}
interface IPrefilter {
(path: string[], key: string): boolean;
}
interface IDeepDiff {
diff(lhs: Object, rhs: Object, prefilter?: IPrefilter, acc?: IAccumulator): IDiff[];
diff(): IDiff;
observableDiff(lhs: Object, rhs: Object, changes: Function, prefilter?: IPrefilter, path?: string[], key?: string, stack?: Object[]): void;
applyDiff(target: Object, source: Object, filter: Function): void;
applyChange(target: Object, source: Object, change: IDiff): void;
revertChange(target: Object, source: Object, change: IDiff): void;
isConflict(): boolean;
noConflict(): IDeepDiff;
}
export interface DiffNew<RHS> {
kind: 'N';
path?: any[];
rhs: RHS;
}
declare var DeepDiff: deepDiff.IDeepDiff;
declare module "deep-diff" {
var diff: deepDiff.IDeepDiff;
export = diff;
export interface DiffDeleted<LHS> {
kind: 'D';
path?: any[];
lhs: LHS;
}
export interface DiffEdit<LHS, RHS = LHS> {
kind: 'E';
path?: any[];
lhs: LHS;
rhs: RHS;
}
export interface DiffArray<LHS, RHS = LHS> {
kind: 'A';
path?: any[];
index: number;
item: Diff<LHS, RHS>;
}
export type Diff<LHS, RHS = LHS> = DiffNew<RHS> | DiffDeleted<LHS> | DiffEdit<LHS, RHS> | DiffArray<LHS, RHS>;
export type PreFilterFunction = (path: any[], key: any) => boolean;
export interface PreFilterObject<LHS, RHS = LHS> {
prefilter?(path: any[], key: any): boolean;
normalize?(currentPath: any, key: any, lhs: LHS, rhs: RHS): [ LHS, RHS ] | undefined;
}
export type PreFilter<LHS, RHS = LHS> = PreFilterFunction | PreFilterObject<LHS, RHS>;
export interface Accumulator<LHS, RHS = LHS> {
push(diff: Diff<LHS, RHS>): void;
length: number;
}
export type Observer<LHS, RHS = LHS> = (diff: Diff<LHS, RHS>) => void;
export type Filter<LHS, RHS = LHS> = (target: LHS, source: RHS, change: Diff<LHS, RHS>) => boolean;
export function diff<LHS, RHS = LHS>(lhs: LHS, rhs: RHS, prefilter?: PreFilter<LHS, RHS>): Array<Diff<LHS, RHS>> | undefined;
export function diff<LHS, RHS = LHS>(lhs: LHS, rhs: RHS, prefilter?: PreFilter<LHS, RHS>, acc?: Accumulator<LHS, RHS>): Accumulator<LHS, RHS>;
export function orderIndependentDiff<LHS, RHS = LHS>(lhs: LHS, rhs: RHS, prefilter?: PreFilter<LHS, RHS>): Array<Diff<LHS, RHS>> | undefined;
export function orderIndependentDiff<LHS, RHS = LHS>(lhs: LHS, rhs: RHS, prefilter?: PreFilter<LHS, RHS>, acc?: Accumulator<LHS, RHS>): Accumulator<LHS, RHS>;
export function observableDiff<LHS, RHS = LHS>(lhs: LHS, rhs: RHS, observer?: Observer<LHS, RHS>, prefilter?: PreFilter<LHS, RHS>, orderIndependent?: boolean): Array<Diff<LHS, RHS>>;
export function orderIndependentDeepDiff<LHS, RHS = LHS>(lhs: LHS, rhs: RHS, changes: Array<Diff<LHS, RHS>>, prefilter: PreFilter<LHS, RHS>, path: any[], key: any, stack: any[]): void;
export function orderIndepHash(object: any): number;
export function applyDiff<LHS, RHS = LHS>(target: LHS, source: RHS, filter?: Filter<LHS, RHS>): void;
export function applyChange<LHS>(target: LHS, source: any, change: Diff<LHS, any>): void;
export function revertChange<LHS>(target: LHS, source: any, change: Diff<LHS, any>): void;
+1 -79
View File
@@ -1,79 +1 @@
{
"extends": "dtslint/dt.json",
"rules": {
"adjacent-overload-signatures": false,
"array-type": false,
"arrow-return-shorthand": false,
"ban-types": false,
"callable-types": false,
"comment-format": false,
"dt-header": false,
"eofline": false,
"export-just-namespace": false,
"import-spacing": false,
"interface-name": false,
"interface-over-type-literal": false,
"jsdoc-format": false,
"max-line-length": false,
"member-access": false,
"new-parens": false,
"no-any-union": false,
"no-boolean-literal-compare": false,
"no-conditional-assignment": false,
"no-consecutive-blank-lines": false,
"no-construct": false,
"no-declare-current-package": false,
"no-duplicate-imports": false,
"no-duplicate-variable": false,
"no-empty-interface": false,
"no-for-in-array": false,
"no-inferrable-types": false,
"no-internal-module": false,
"no-irregular-whitespace": false,
"no-mergeable-namespace": false,
"no-misused-new": false,
"no-namespace": false,
"no-object-literal-type-assertion": false,
"no-padding": false,
"no-redundant-jsdoc": false,
"no-redundant-jsdoc-2": false,
"no-redundant-undefined": false,
"no-reference-import": false,
"no-relative-import-in-test": false,
"no-self-import": false,
"no-single-declare-module": false,
"no-string-throw": false,
"no-unnecessary-callback-wrapper": false,
"no-unnecessary-class": false,
"no-unnecessary-generics": false,
"no-unnecessary-qualifier": false,
"no-unnecessary-type-assertion": false,
"no-useless-files": false,
"no-var-keyword": false,
"no-var-requires": false,
"no-void-expression": false,
"no-trailing-whitespace": false,
"object-literal-key-quotes": false,
"object-literal-shorthand": false,
"one-line": false,
"one-variable-per-declaration": false,
"only-arrow-functions": false,
"prefer-conditional-expression": false,
"prefer-const": false,
"prefer-declare-function": false,
"prefer-for-of": false,
"prefer-method-signature": false,
"prefer-template": false,
"radix": false,
"semicolon": false,
"space-before-function-paren": false,
"space-within-parens": false,
"strict-export-declare-modifiers": false,
"trim-file": false,
"triple-equals": false,
"typedef-whitespace": false,
"unified-signatures": false,
"void-return": false,
"whitespace": false
}
}
{ "extends": "dtslint/dt.json" }
+23
View File
@@ -16,6 +16,29 @@ diffArraysResult.forEach(result => {
}
});
interface DiffObj {
value: number;
}
const a: DiffObj = {value: 0};
const b: DiffObj = {value: 1};
const c: DiffObj = {value: 2};
const d: DiffObj = {value: 3};
const arrayOptions: jsdiff.IArrayOptions = {
comparator: (left: DiffObj, right: DiffObj) => {
return left.value === right.value;
}
};
const diffResult = jsdiff.diffArrays([a, b, c], [a, b, d], arrayOptions);
diffResult.forEach(result => {
if (result.added) {
console.log(`added ${result.value.length} line(s):`, ...result.value);
} else if (result.removed) {
console.log(`removed ${result.value.length} line(s):`, ...result.value);
} else {
console.log(`no changes`);
}
});
// --------------------------
class LineDiffWithoutWhitespace extends jsdiff.Diff {
+3 -2
View File
@@ -2,6 +2,7 @@
// Project: https://github.com/kpdecker/jsdiff
// Definitions by: vvakame <https://github.com/vvakame>
// szdc <https://github.com/szdc>
// moc-yuto <https://github.com/moc-yuto>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
@@ -18,8 +19,8 @@ declare namespace JsDiff {
newlineIsToken?: boolean;
}
interface IArrayOptions extends IOptions {
comparator?: (left: any, right: any) => number;
interface IArrayOptions {
comparator?: (left: any, right: any) => boolean;
}
interface IDiffResult {
+61 -4
View File
@@ -328,6 +328,20 @@ declare namespace Dockerode {
MacAddress: string;
}
// not complete definition of network inspection
// info which is returned by list / inspect
interface NetworkInspectInfo {
Id: string;
Name: string;
Driver: string;
Created: string;
Scope: string;
EnableIPv6: boolean;
Internal: boolean;
Attachable: boolean;
Ingress: boolean;
}
interface ContainerInspectInfo {
Id: string;
Created: string;
@@ -573,6 +587,49 @@ declare namespace Dockerode {
};
}
interface AuthConfig {
username: string;
password: string;
serveraddress: string;
email?: string;
}
interface PortBinding {
HostIp?: string;
HostPort?: string;
}
interface PortMap {
[key: string]: PortBinding[];
}
interface RestartPolicy {
Name: string;
MaximumRetryCount?: number;
}
type LoggingDriverType =
| "json-file"
| "syslog"
| "journald"
| "gelf"
| "fluentd"
| "awslogs"
| "splunk"
| "etwlogs"
| "none";
interface LogConfig {
Type: LoggingDriverType;
Config?: { [key: string]: string };
}
interface DeviceMapping {
PathOnHost: string;
PathinContainer: string;
CgroupPermissions: string;
}
interface ContainerCreateOptions {
name?: string;
Hostname?: string;
@@ -620,7 +677,7 @@ declare namespace Dockerode {
OomScoreAdj?: number;
PidMode?: string;
PidsLimit?: number;
PortBindings?: { [portAndProtocol: string]: Array<{ [index: string]: string }> };
PortBindings?: PortMap;
PublishAllPorts?: boolean;
Privileged?: boolean;
ReadonlyRootfs?: boolean;
@@ -632,12 +689,12 @@ declare namespace Dockerode {
CapAdd?: string[];
CapDrop?: string[];
GroupAdd?: string[];
RestartPolicy?: { [index: string]: number | string };
RestartPolicy?: RestartPolicy;
NetworkMode?: string;
Devices?: any[];
Devices?: DeviceMapping[];
Sysctls?: { [index: string]: string };
Ulimits?: Array<{}>;
LogConfig?: { [index: string]: string | {} };
LogConfig?: LogConfig;
SecurityOpt?: { [index: string]: any };
CgroupParent?: string;
VolumeDriver?: string;
+3 -3
View File
@@ -2855,7 +2855,7 @@ declare module dijit {
get(property:"ownerDocument"): Object;
watch(property:"ownerDocument", callback:{(property?:string, oldValue?:Object, newValue?: Object):void}) :{unwatch():void}
/**
* A parameter needed by RadioGroupSlide only. An optional paramter to force
* A parameter needed by RadioGroupSlide only. An optional parameter to force
* the ContentPane to slide in from a set direction. Defaults
* to "random", or specify one of "top", "left", "right", "bottom"
* to slideFrom top, left, right, or bottom.
@@ -6801,7 +6801,7 @@ declare module dijit {
get(property:"searchContainerNode"): boolean;
watch(property:"searchContainerNode", callback:{(property?:string, oldValue?:boolean, newValue?: boolean):void}) :{unwatch():void}
/**
* A parameter needed by RadioGroupSlide only. An optional paramter to force
* A parameter needed by RadioGroupSlide only. An optional parameter to force
* the ContentPane to slide in from a set direction. Defaults
* to "random", or specify one of "top", "left", "right", "bottom"
* to slideFrom top, left, right, or bottom.
@@ -104923,7 +104923,7 @@ declare module dijit {
get(property:"searchContainerNode"): boolean;
watch(property:"searchContainerNode", callback:{(property?:string, oldValue?:boolean, newValue?: boolean):void}) :{unwatch():void}
/**
* A parameter needed by RadioGroupSlide only. An optional paramter to force
* A parameter needed by RadioGroupSlide only. An optional parameter to force
* the ContentPane to slide in from a set direction. Defaults
* to "random", or specify one of "top", "left", "right", "bottom"
* to slideFrom top, left, right, or bottom.
+5 -5
View File
@@ -17225,7 +17225,7 @@ declare namespace dojox {
get(property:"searchContainerNode"): boolean;
watch(property:"searchContainerNode", callback:{(property?:string, oldValue?:boolean, newValue?: boolean):void}) :{unwatch():void}
/**
* A parameter needed by RadioGroupSlide only. An optional paramter to force
* A parameter needed by RadioGroupSlide only. An optional parameter to force
* the ContentPane to slide in from a set direction. Defaults
* to "random", or specify one of "top", "left", "right", "bottom"
* to slideFrom top, left, right, or bottom.
@@ -18171,7 +18171,7 @@ declare namespace dojox {
get(property:"searchContainerNode"): boolean;
watch(property:"searchContainerNode", callback:{(property?:string, oldValue?:boolean, newValue?: boolean):void}) :{unwatch():void}
/**
* A parameter needed by RadioGroupSlide only. An optional paramter to force
* A parameter needed by RadioGroupSlide only. An optional parameter to force
* the ContentPane to slide in from a set direction. Defaults
* to "random", or specify one of "top", "left", "right", "bottom"
* to slideFrom top, left, right, or bottom.
@@ -23352,7 +23352,7 @@ declare namespace dojox {
get(property:"refreshOnShow"): boolean;
watch(property: "refreshOnShow", callback: { (property?: string, oldValue?: boolean, newValue?: boolean): void }): { unwatch(): void }
/**
* A parameter needed by RadioGroupSlide only. An optional paramter to force
* A parameter needed by RadioGroupSlide only. An optional parameter to force
* the ContentPane to slide in from a set direction. Defaults
* to "random", or specify one of "top", "left", "right", "bottom"
* to slideFrom top, left, right, or bottom.
@@ -24411,7 +24411,7 @@ declare namespace dojox {
get(property:"ownerDocument"): Object;
watch(property:"ownerDocument", callback:{(property?:string, oldValue?:Object, newValue?: Object):void}) :{unwatch():void}
/**
* A parameter needed by RadioGroupSlide only. An optional paramter to force
* A parameter needed by RadioGroupSlide only. An optional parameter to force
* the ContentPane to slide in from a set direction. Defaults
* to "random", or specify one of "top", "left", "right", "bottom"
* to slideFrom top, left, right, or bottom.
@@ -25307,7 +25307,7 @@ declare namespace dojox {
get(property:"searchContainerNode"): boolean;
watch(property:"searchContainerNode", callback:{(property?:string, oldValue?:boolean, newValue?: boolean):void}) :{unwatch():void}
/**
* A parameter needed by RadioGroupSlide only. An optional paramter to force
* A parameter needed by RadioGroupSlide only. An optional parameter to force
* the ContentPane to slide in from a set direction. Defaults
* to "random", or specify one of "top", "left", "right", "bottom"
* to slideFrom top, left, right, or bottom.
+16 -1
View File
@@ -1,10 +1,14 @@
// Type definitions for DOM Purify
// Project: https://github.com/cure53/DOMPurify
// Definitions by: Dave Taylor <http://davetayls.me>, Samira Bazuzi <https://github.com/bazuzi>
// Definitions by: Dave Taylor <http://davetayls.me>, Samira Bazuzi <https://github.com/bazuzi>, FlowCrypt <https://github.com/FlowCrypt>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export as namespace DOMPurify;
export declare let version: string;
export declare let removed: any[];
export declare let isSupported: boolean;
export declare function sanitize(source: string | Node): string;
export declare function sanitize(source: string | Node, config: Config & { RETURN_DOM_FRAGMENT?: false; RETURN_DOM?: false; }): string;
export declare function sanitize(source: string | Node, config: Config & { RETURN_DOM_FRAGMENT: true; }): DocumentFragment;
@@ -13,6 +17,12 @@ export declare function sanitize(source: string | Node, config: Config): string
export declare function addHook(hook: 'uponSanitizeElement', cb: (currentNode: Element, data: SanitizeElementHookEvent, config: Config) => void): void;
export declare function addHook(hook: 'uponSanitizeAttribute', cb: (currentNode: Element, data: SanitizeAttributeHookEvent, config: Config) => void): void;
export declare function addHook(hook: HookName, cb: (currentNode: Element, data: HookEvent, config: Config) => void): void;
export declare function setConfig(cfg: Config): void;
export declare function clearConfig(): void;
export declare function isValidAttribute(tag: string, attr: string, value: string): boolean;
export declare function removeHook(entryPoint: HookName): void;
export declare function removeHooks(entryPoint: HookName): void;
export declare function removeAllHooks(): void;
interface Config {
ADD_ATTR?: string[];
@@ -30,6 +40,11 @@ interface Config {
SAFE_FOR_JQUERY?: boolean;
SANITIZE_DOM?: boolean;
WHOLE_DOCUMENT?: boolean;
ALLOWED_URI_REGEXP?: RegExp;
SAFE_FOR_TEMPLATES?: boolean;
ALLOW_UNKNOWN_PROTOCOLS?: boolean;
USE_PROFILES?: false | {mathMl?: boolean, svg?: boolean, svgFilters?: boolean, html?: boolean};
IN_PLACE?: boolean;
}
type HookName
+1
View File
@@ -7,6 +7,7 @@ download(new Blob(['hello world']), 'dlTextBlob.txt', 'text/plain');
download('/robots.txt');
// tslint:disable-next-line no-unnecessary-type-assertion
download(document.documentElement!.outerHTML, 'dlHTML.html', 'text/html');
download(new Blob(['hello world'.bold()]), 'dlHtmlBlob.html', 'text/html');
download('/diff6.png');
+8
View File
@@ -8,9 +8,17 @@ duplexify(writable, readable);
duplexify(writable);
duplexify(undefined, readable);
duplexify.obj();
duplexify.obj(writable);
duplexify.obj(writable, readable);
duplexify.obj(writable, readable, {});
const d: duplexify.Duplexify = duplexify();
d.setReadable(readable);
d.setReadable(); // $ExpectError
d.setWritable(writable);
d.setWritable(); // $ExpectError
d.cork();
d.uncork();
const f: Duplex = d;
+6 -1
View File
@@ -1,6 +1,7 @@
// Type definitions for duplexify 3.5
// Type definitions for duplexify 3.6
// Project: https://github.com/mafintosh/duplexify
// Definitions by: Sami Kukkonen <https://github.com/strax>
// Jonathan Lui <https://github.com/kinwa91>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node" />
@@ -11,10 +12,14 @@ export = duplexify;
interface DuplexifyConstructor {
(writable?: stream.Writable, readable?: stream.Readable, streamOptions?: stream.DuplexOptions): duplexify.Duplexify;
new (writable?: stream.Writable, readable?: stream.Readable, streamOptions?: stream.DuplexOptions): duplexify.Duplexify;
obj(writable?: stream.Writable, readable?: stream.Readable, streamOptions?: stream.DuplexOptions): duplexify.Duplexify;
}
declare var duplexify: DuplexifyConstructor;
declare namespace duplexify {
interface Duplexify extends stream.Duplex {
cork(): void;
uncork(): void;
setWritable(writable: stream.Writable): void;
setReadable(readable: stream.Readable): void;
}
+1 -1
View File
@@ -101,7 +101,7 @@ interface DurandalSystemModule {
/**
* Creates a deferred object which can be used to create a promise. Optionally pass a function action to perform which will be passed an object used in resolving the promise.
* @param {function} [action] The action to defer. You will be passed the deferred object as a paramter.
* @param {function} [action] The action to defer. You will be passed the deferred object as a parameter.
* @returns {Deferred} The deferred object.
*/
defer<T>(action?: (dfd: DurandalDeferred<T>) => void): DurandalDeferred<T>;
+7 -7
View File
@@ -1372,7 +1372,7 @@ declare enum EnumDWT_UploadDataFormat {
Base64 = 1
}
/**
/**
* interface for a DWT container which basically defines a DIV on the page
*/
interface Container {
@@ -1381,7 +1381,7 @@ interface Container {
Height: string | number;
}
/**
/**
* interface for a base64 result
*/
interface Base64Result {
@@ -2294,7 +2294,7 @@ interface WebTwain {
*/
Zoom: number;
/* ignored
/* ignored
style
_AutoCropMethod
*/
@@ -2490,7 +2490,7 @@ interface WebTwain {
* @param {Array} indices indices specifies which images are to be converted to base64.
* @param {EnumDWT_ImageType} enumImageType the image format in which the images are to be converted to base64.
* @return {Base64Result}
ConvertToBase64(indices: number[], enumImageType: EnumDWT_ImageType): Base64Result;
*/
@@ -3289,7 +3289,7 @@ interface WebTwain {
*/
MoveImage(sSourceImageIndex: number, sTargetImageIndex: number): boolean;
/*ignored
/*ignored
OnRefreshUI
*/
@@ -3727,7 +3727,7 @@ interface WebTwain {
* @param {string} InitialDir The initial directory. The algorithm for selecting the initial directory varies on different platforms.
* @param {boolean} AllowMultiSelect True -- allows users to select more than one file, False -- only allows to select one file.
* @param {boolean} OverwritePrompt True -- If a file already exists with the same name, the old file will be simply overwritten, False -- not allows to save and overwrite a same name file.
* @param {number} Flags If this parameter equals 0, the program will be initiated with the default flags, otherwise initiated with the cumstom value and paramters "AllowMultiSelect" and "OverwritePrompt" will be useless.
* @param {number} Flags If this parameter equals 0, the program will be initiated with the default flags, otherwise initiated with the cumstom value and parameters "AllowMultiSelect" and "OverwritePrompt" will be useless.
* @return {boolean}
*/
ShowFileDialog(SaveDialog: boolean, Filter: string, FilterIndex: number, DefExtension: string, InitialDir: string, AllowMultiSelect: boolean, OverwritePrompt: boolean, Flags: number): boolean;
@@ -3751,7 +3751,7 @@ interface WebTwain {
*/
ShowImageEditorEx(x: number, y: number, cx: number, cy: number, nCmdShow: number): boolean;
/*ingored
/*ingored
SourceNameItems
*/
+1 -1
View File
@@ -2768,7 +2768,7 @@ interface WebTwain {
* @param {string} InitialDir The initial directory. The algorithm for selecting the initial directory varies on different platforms.
* @param {bool} AllowMultiSelect True -- allows users to select more than one file, False -- only allows to select one file.
* @param {bool} OverwritePrompt True -- If a file already exists with the same name, the old file will be simply overwritten, False -- not allows to save and overwrite a same name file.
* @param {int} Flags If this parameter equals 0, the program will be initiated with the default flags, otherwise initiated with the cumstom value and paramters "AllowMultiSelect" and "OverwritePrompt" will be useless.
* @param {int} Flags If this parameter equals 0, the program will be initiated with the default flags, otherwise initiated with the cumstom value and parameters "AllowMultiSelect" and "OverwritePrompt" will be useless.
* @return {bool}
*/
ShowFileDialog(SaveDialog: boolean, Filter: string, FilterIndex: number, DefExtension: string, InitialDir: string, AllowMultiSelect: boolean, OverwritePrompt: boolean, Flags: number): boolean;
+1 -1
View File
@@ -101,7 +101,7 @@ export interface CommonWrapper<P = {}, S = {}, C = Component<P, S>> {
/**
* Returns whether or not the current node exists.
*/
exists(): boolean;
exists(selector?: EnzymeSelector): boolean;
/**
* Returns a new wrapper with only the nodes of the current wrapper that don't match the provided selector.
@@ -0,0 +1,4 @@
import { Localization } from "expo-localization";
Localization.getLocalizationAsync().then(localization => localization.locale);
Localization.locale;
+73
View File
@@ -0,0 +1,73 @@
// Type definitions for expo-localization 1.0
// Project: https://docs.expo.io/
// Definitions by: Bartosz Dotryw <https://github.com/burtek>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export interface LocalizationProps {
/**
* Native device language, returned in standard format. ex: `en-US`, `es-US`
*/
locale: string;
/**
* List of all the native languages provided by the user settings. These are returned in the order the user defines in their native settings
*/
locales: string[];
/**
* Country code for your device
*/
country: string | undefined | null;
/**
* A list of all the supported ISO codes
*/
isoCurrencyCodes: string[] | undefined | null;
/**
* The current time zone in display format. ex: `America/Los_Angeles`
*/
timezone: string;
/**
* This will return `true` if the current language is Right-to-Left
*/
isRTL: boolean;
}
export namespace Localization {
/**
* Native device language, returned in standard format. ex: `en-US`, `es-US`
*/
const locale: string;
/**
* List of all the native languages provided by the user settings. These are returned in the order the user defines in their native settings
*/
const locales: string[];
/**
* Country code for your device
*/
const country: string | undefined | null;
/**
* A list of all the supported ISO codes
*/
const isoCurrencyCodes: string[] | undefined | null;
/**
* The current time zone in display format. ex: `America/Los_Angeles`
*/
const timezone: string;
/**
* This will return `true` if the current language is Right-to-Left
*/
const isRTL: boolean;
/**
* Android only, on iOS changing the locale settings will cause all the apps to reset
*/
function getLocalizationAsync(): Promise<LocalizationProps>;
}
+23
View 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",
"expo-localization-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }
+1 -2
View File
@@ -104,7 +104,7 @@ export function warn(...values: any[]): void;
///////////////////////////////////////////////////////////////////////////////
// Data Object Interfaces - These intrface are not specific part of fabric,
// They are just helpful for for defining function paramters
// They are just helpful for for defining function parameters
//////////////////////////////////////////////////////////////////////////////
interface IDataURLOptions {
/**
@@ -4682,4 +4682,3 @@ export interface WebglFilterBackend extends FilterBackend, WebglFilterBackendOpt
export class WebglFilterBackend {
constructor(options?: WebglFilterBackendOptions);
}
-16
View File
@@ -1,16 +0,0 @@
import fastDiff = require('fast-diff');
let diffs: fastDiff.Diff[];
diffs = fastDiff("hi there", "hi");
diffs = fastDiff("hi there", "hi", 1);
diffs.forEach((diff: fastDiff.Diff) => {
const operation: number = diff[0];
const text: string = diff[1];
switch (diff[0]) {
case fastDiff.EQUAL: break;
case fastDiff.DELETE: break;
case fastDiff.INSERT: break;
}
});
-16
View File
@@ -1,16 +0,0 @@
// Type definitions for fast-diff 1.1
// Project: https://github.com/jhchen/fast-diff#readme
// Definitions by: John Renner <https://github.com/djrenren>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare function diff(text1: string, text2: string, cursorPos?: number): diff.Diff[];
declare namespace diff {
type Diff = [-1 | 0 | 1, string];
const DELETE: -1;
const INSERT: 1;
const EQUAL: 0;
}
export = diff;
+11
View File
@@ -22,6 +22,17 @@ function testWindowSaveAs() {
window.saveAs(data, filename, disableAutoBOM);
}
/**
* @summary Test for "saveAs" function with URL as first argument.
*/
function testUrlSaveAs() {
const url = 'https://example.com/test.txt';
const filename = 'hello world.txt';
const disableAutoBOM = true;
window.saveAs(url, filename, disableAutoBOM);
}
/**
* @summary Test for "saveAs" function with the 3rd parameter omitted
*/
+3 -3
View File
@@ -1,4 +1,4 @@
// Type definitions for FileSaver.js 1.3
// Type definitions for FileSaver.js 2.0
// Project: https://github.com/eligrey/FileSaver.js/
// Definitions by: Cyril Schumacher <https://github.com/cyrilschumacher>
// Daniel Roth <https://github.com/DaIgeb>
@@ -8,11 +8,11 @@
declare namespace FileSaver {
/**
* FileSaver.js implements the saveAs() FileSaver interface in browsers that do not natively support it.
* @param data - The actual file data blob.
* @param data - The actual file data blob or URL.
* @param filename - The optional name of the file to be downloaded. If omitted, the name used in the file data will be used. If none is provided "download" will be used.
* @param disableAutoBOM - Optional & defaults to `false`. Set to `true` if you want FileSaver.js to automatically provide Unicode text encoding hints
*/
function saveAs(data: Blob, filename?: string, disableAutoBOM?: boolean): void;
function saveAs(data: Blob | string, filename?: string, disableAutoBOM?: boolean): void;
}
declare global {
+1 -1
View File
@@ -3,7 +3,7 @@
// Definitions by: Christopher E. Woodland <https://github.com/cwoodland>
// Johnny Li <https://github.com/johnny4753>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.6
// TypeScript Version: 2.8
/// <reference types='jasmine'/>
+1 -1
View File
@@ -2,7 +2,7 @@
// Project: https://github.com/vlucas/frisby
// Definitions by: Johnny Li <https://github.com/johnny4753>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
// TypeScript Version: 2.8
///<reference types="jasmine"/>
+59 -60
View File
@@ -1,70 +1,69 @@
/// <reference types="node" />
import gamepad = require('gamepad');
// Initialize the library
gamepad.init();
// List the state of all currently attached devices
for (let i = 0, l = gamepad.numDevices(); i < l; i++) {
console.log(i, gamepad.deviceAtIndex(i));
}
()=>{
function runAnimation()
{
window.requestAnimationFrame(runAnimation);
// Create a game loop and poll for events
setInterval(gamepad.processEvents, 16);
// Scan for new gamepads as a slower rate
setInterval(gamepad.detectDevices, 500);
var gamepads = navigator.getGamepads();
for (var i = 0; i < gamepads.length; ++i)
{
var pad = gamepads[i];
// todo; simple demo of displaying pad.axes and pad.buttons
// Listen for new gamepads being attached
gamepad.on('attach', (deviceID, device) => {
console.log('attach', {
deviceID,
device: {
deviceID: device.deviceID,
description: device.description,
vendorID: device.vendorID,
productID: device.productID,
axisStates: device.axisStates,
buttonStates: device.buttonStates,
}
}
});
});
window.requestAnimationFrame(runAnimation);
};
// Listen for new gamepads being removed
gamepad.on('remove', deviceID => {
console.log('remove', {
deviceID
});
});
(()=>{
var gamepadconnected = (e: Gamepad.GamepadEvent) => {
console.log('Gamepad ' + e.gamepad.index + ' connected!');
if(e.gamepad.mapping == 'standard'){
console.log("The Gamepad's controls have been mapped to the Standard Gamepad layout.");
}
};
var gamepaddisconnected = (e: Gamepad.GamepadEvent) => {
console.log('Gamepad ' + e.gamepad.index + ' disconnected!');
};
// Listen for button down events on all gamepads
gamepad.on('up', (deviceID, buttonID, timestamp) => {
console.log('up', {
deviceID,
buttonID,
timestamp
});
});
window.addEventListener('GamepadConnected', gamepadconnected, false);
window.addEventListener('GamepadDisconnected', gamepaddisconnected, false);
window.addEventListener('webkitGamepadConnected', gamepadconnected, false);
window.addEventListener('webkitGamepadDisconnected', gamepaddisconnected, false);
window.addEventListener('mozGamepadConnected', gamepadconnected, false);
window.addEventListener('mozGamepadDisconnected', gamepaddisconnected, false);
// Listen for button down events on all gamepads
gamepad.on('down', (deviceID, buttonID, timestamp) => {
console.log('down', {
deviceID,
buttonID,
timestamp
});
});
var requestAnimationFrame = window.requestAnimationFrame || (<any>window).mozRequestAnimationFrame;
var getGamepads = navigator.getGamepads || navigator.webkitGetGamepads;
if(getGamepads){
function runAnimation()
{
requestAnimationFrame.call(window, runAnimation);
// Listen for move events on all gamepads
gamepad.on('move', (deviceID, axisID, value, lastValue, timestamp) => {
console.log('move', {
deviceID,
axisID,
value,
lastValue,
timestamp
});
});
var gamepads: Gamepad.Gamepad[] = getGamepads.call(navigator);
for(var i = 0; i < gamepads.length; i++){
var pad: Gamepad.Gamepad = gamepads[i];
if(pad && pad.connected){
for (var k = 0; k < pad.buttons.length; k++)
{
var button: Gamepad.GamepadButton = pad.buttons[k];
if(button.pressed){
console.log('pad[' + pad.index + ']: ' + 'time=' + pad.timestamp + ' id="' + pad.id + '" button[' + k + '] = ' + button.value);
}
}
for (var k = 0; k < pad.axes.length; k++)
{
var axis = pad.axes[k];
if(Math.abs(axis) > 0.1){
console.log('pad[' + pad.index + ']: ' + 'time=' + pad.timestamp + ' id="' + pad.id + '" axis[' + k + '] = ' + axis);
}
}
}
}
}
runAnimation();
}
})();
// Shutdown the library
gamepad.shutdown();
+25 -89
View File
@@ -1,97 +1,33 @@
// Type definitions for Gamepad API
// Project: http://www.w3.org/TR/gamepad/
// Definitions by: Kon <http://phyzkit.net/>
// Type definitions for gamepad 1.5
// Project: https://github.com/creationix/node-gamepad#readme
// Definitions by: Alex Van Camp <https://github.com/Lange>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.4
declare namespace Gamepad{
/**
* This interface defines an individual gamepad device.
*/
export interface Gamepad{
/**
* An identification string for the gamepad. This string identifies the brand or style of connected gamepad device. Typically, this will include the USB vendor and a product ID.
* @readonly
*/
id:string;
import { EventEmitter } from 'events';
/**
* The index of the gamepad in the Navigator. When multiple gamepads are connected to a user agent, indices must be assigned on a first-come, first-serve basis, starting at zero. If a gamepad is disconnected, previously assigned indices must not be reassigned to gamepads that continue to be connected. However, if a gamepad is disconnected, and subsequently the same or a different gamepad is then connected, index entries must be reused.
* @readonly
*/
index:number;
declare const nodeGamepad: NodeGamepad;
export = nodeGamepad;
/**
* Last time the data for this gamepad was updated. Timestamp is a monotonically increasing value that allows the author to determine if the axes and button data have been updated from the hardware, relative to a previously saved timestamp.
* @readonly
*/
timestamp:number;
interface NodeGamepad extends EventEmitter {
init(): void;
shutdown(): void;
numDevices(): number;
deviceAtIndex(deviceIndex: number): GamepadInstance;
detectDevices(): void;
processEvents(): void;
/**
* Array of values for all axes of the gamepad. All axis values must be linearly normalized to the range [-1.0 .. 1.0]. As appropriate, -1.0 should correspond to "up" or "left", and 1.0 should correspond to "down" or "right". Axes that are drawn from a 2D input device should appear next to each other in the axes array, X then Y. It is recommended that axes appear in decreasing order of importance, such that element 0 and 1 typically represent the X and Y axis of a directional stick.
* @readonly
*/
axes:number[];
/**
* Array of values for all buttons of the gamepad. All button values must be linearly normalized to the range [0.0 .. 1.0]. 0.0 must mean fully unpressed, and 1.0 must mean fully pressed. It is recommended that buttons appear in decreasing importance such that the primary button, secondary button, tertiary button, and so on appear as elements 0, 1, 2, ... in the buttons array.
* @readonly
*/
buttons:GamepadButton[];
/**
* Indicates whether the physical device represented by this object is still connected to the system. When a gamepad becomes unavailable, whether by being physically disconnected, powered off or otherwise unusable, the connected attribute must be set to false.
* @readonly
*/
connected:boolean;
/**
* The mapping in use for this device. If the user agent has knowledge of the layout of the device, then it should indicate that a mapping is in use by setting this property to a known mapping name. Currently the only known mapping is "standard", which corresponds to the Standard Gamepad layout. If the user agent does not have knowledge of the device layout and is simply providing the controls as represented by the driver in use, then it must set the mapping property to an empty string.
* @readonly
*/
mapping:string;
}
/**
*
*/
export interface GamepadEvent extends Event{
/**
* The single gamepad attribute provides access to the associated gamepad data for this event.
* @readonly
*/
gamepad:Gamepad;
}
export interface GamepadList{
[index: number]: Gamepad;
length: number;
}
export interface GamepadButton{
pressed: boolean;
value: number;
}
/*
* @event gamepadconnected
* A user agent must dispatch this event type to indicate the user has connected a gamepad. If a gamepad was already connected when the page was loaded, the gamepadconnected event will be dispatched when the user presses a button or moves an axis.
*/
/*
* @event gamepaddisconnected
* When a gamepad is disconnected from the user agent, if the user agent has previously dispatched a gamepadconnected event, a gamepaddisconnected event must be dispatched.
*/
on(event: 'attach', listener: (deviceID: number, device: GamepadInstance) => void): this;
on(event: 'remove', listener: (deviceID: number) => void): this;
on(event: 'down' | 'up', listener: (deviceID: number, buttonID: number, timestamp: number) => void): this;
on(event: 'move', listener: (deviceID: number, axisID: number, value: number, lastValue: number, timestamp: number) => void): this;
}
interface Navigator{
/**
* The currently connected and interacted-with gamepads. Gamepads must only appear in the list if they are currently connected to the user agent, and have been interacted with by the user. Otherwise, they must not appear in the list to avoid a malicious page from fingerprinting the user based on connected devices.
* @readonly
*/
getGamepads(): Gamepad.Gamepad[];
webkitGetGamepads(): Gamepad.GamepadList;
// Not supported yet :(
// mozGetGamepads(): Gamepad[];
interface GamepadInstance {
deviceID: number;
description: string;
vendorID: number;
productID: number;
axisStates: number[];
buttonStates: boolean[];
}
+4 -5
View File
@@ -2,13 +2,12 @@
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6",
"dom"
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": false,
"strictFunctionTypes": false,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
@@ -21,4 +20,4 @@
"index.d.ts",
"gamepad-tests.ts"
]
}
}
+1 -77
View File
@@ -1,79 +1,3 @@
{
"extends": "dtslint/dt.json",
"rules": {
"adjacent-overload-signatures": false,
"array-type": false,
"arrow-return-shorthand": false,
"ban-types": false,
"callable-types": false,
"comment-format": false,
"dt-header": false,
"eofline": false,
"export-just-namespace": false,
"import-spacing": false,
"interface-name": false,
"interface-over-type-literal": false,
"jsdoc-format": false,
"max-line-length": false,
"member-access": false,
"new-parens": false,
"no-any-union": false,
"no-boolean-literal-compare": false,
"no-conditional-assignment": false,
"no-consecutive-blank-lines": false,
"no-construct": false,
"no-declare-current-package": false,
"no-duplicate-imports": false,
"no-duplicate-variable": false,
"no-empty-interface": false,
"no-for-in-array": false,
"no-inferrable-types": false,
"no-internal-module": false,
"no-irregular-whitespace": false,
"no-mergeable-namespace": false,
"no-misused-new": false,
"no-namespace": false,
"no-object-literal-type-assertion": false,
"no-padding": false,
"no-redundant-jsdoc": false,
"no-redundant-jsdoc-2": false,
"no-redundant-undefined": false,
"no-reference-import": false,
"no-relative-import-in-test": false,
"no-self-import": false,
"no-single-declare-module": false,
"no-string-throw": false,
"no-unnecessary-callback-wrapper": false,
"no-unnecessary-class": false,
"no-unnecessary-generics": false,
"no-unnecessary-qualifier": false,
"no-unnecessary-type-assertion": false,
"no-useless-files": false,
"no-var-keyword": false,
"no-var-requires": false,
"no-void-expression": false,
"no-trailing-whitespace": false,
"object-literal-key-quotes": false,
"object-literal-shorthand": false,
"one-line": false,
"one-variable-per-declaration": false,
"only-arrow-functions": false,
"prefer-conditional-expression": false,
"prefer-const": false,
"prefer-declare-function": false,
"prefer-for-of": false,
"prefer-method-signature": false,
"prefer-template": false,
"radix": false,
"semicolon": false,
"space-before-function-paren": false,
"space-within-parens": false,
"strict-export-declare-modifiers": false,
"trim-file": false,
"triple-equals": false,
"typedef-whitespace": false,
"unified-signatures": false,
"void-return": false,
"whitespace": false
}
"extends": "dtslint/dt.json"
}
+1 -1
View File
@@ -2237,7 +2237,7 @@ declare namespace gapi.client {
/** Tag format type for the floodlight activity. If left blank, the tag format will default to HTML. */
tagFormat?: string;
/**
* Value of the cat= paramter in the floodlight tag, which the ad servers use to identify the activity. This is optional: if empty, a new tag string will
* Value of the cat= parameter in the floodlight tag, which the ad servers use to identify the activity. This is optional: if empty, a new tag string will
* be generated for you. This string must be 1 to 8 characters long, with valid characters being [a-z][A-Z][0-9][-][ _ ]. This tag string must also be
* unique among activities of the same activity group. This field is read-only after insertion.
*/
+17
View File
@@ -0,0 +1,17 @@
// Type definitions for gl-react-dom 3.15
// Project: https://github.com/gre/gl-react
// Definitions by: Jussi Kinnula <https://github.com/jussikinnula>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
import * as React from 'react';
import * as glReact from 'gl-react';
export interface SurfaceProps extends glReact.SurfaceProps {
width: number;
height: number;
}
export class Surface extends glReact.Surface {
props: SurfaceProps;
}
+24
View File
@@ -0,0 +1,24 @@
{
"files": [
"index.d.ts"
],
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6",
"dom"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true,
"jsx": "preserve"
}
}
+3
View File
@@ -0,0 +1,3 @@
{
"extends": "dtslint/dt.json"
}
+8
View File
@@ -0,0 +1,8 @@
// Type definitions for gl-react-expo 3.16
// Project: https://github.com/gre/gl-react
// Definitions by: Jussi Kinnula <https://github.com/jussikinnula>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
import { Surface } from 'gl-react';
export { Surface };
+24
View File
@@ -0,0 +1,24 @@
{
"files": [
"index.d.ts"
],
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6",
"dom"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true,
"jsx": "preserve"
}
}
+3
View File
@@ -0,0 +1,3 @@
{
"extends": "dtslint/dt.json"
}

Some files were not shown because too many files have changed in this diff Show More