mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-12-03 03:31:47 +00:00
Merge branch 'master' of https://github.com/DefinitelyTyped/DefinitelyTyped
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
// basic usage
|
||||
$(document).ready(() => {
|
||||
$.bootstrapGrowl('Message to show in alert');
|
||||
});
|
||||
|
||||
// with options example
|
||||
let offsetOptions: BootstrapGrowlIfightcrime.OffsetOption = {
|
||||
from: 'top',
|
||||
amount: 20
|
||||
};
|
||||
|
||||
let options: BootstrapGrowlIfightcrime.Options = {
|
||||
ele: 'body',
|
||||
type: 'info',
|
||||
offset: offsetOptions,
|
||||
align: 'right',
|
||||
width: 250,
|
||||
delay: 4000,
|
||||
allow_dismiss: true,
|
||||
stackup_spacing: 10
|
||||
};
|
||||
|
||||
$(document).ready(() => {
|
||||
$.bootstrapGrowl('Alert with options', options);
|
||||
});
|
||||
+78
@@ -0,0 +1,78 @@
|
||||
// Type definitions for Bootstrap Growl Ifightcrime 1.1
|
||||
// Project: https://github.com/ifightcrime/bootstrap-growl
|
||||
// Definitions by: Anderson Friaça <https://github.com/AndersonFriaca>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
/// <reference types="jquery" />
|
||||
|
||||
declare namespace BootstrapGrowlIfightcrime {
|
||||
type OffsetPositionType = 'top' | 'bottom';
|
||||
|
||||
type AlertType = 'info' | 'danger' | 'success' | 'warning' | string | null;
|
||||
|
||||
type AlignType = 'left' | 'center' | 'right';
|
||||
|
||||
interface OffsetOption {
|
||||
/**
|
||||
* Position: top or bottom
|
||||
*/
|
||||
from?: OffsetPositionType;
|
||||
|
||||
/**
|
||||
* Offset amount
|
||||
*/
|
||||
amount?: number;
|
||||
}
|
||||
|
||||
interface Options {
|
||||
/**
|
||||
* Which element to append to
|
||||
*/
|
||||
ele?: string;
|
||||
|
||||
/**
|
||||
* Values of (null, 'info', 'danger', 'success', 'warning') or another value
|
||||
*/
|
||||
type?: AlertType;
|
||||
|
||||
/**
|
||||
* Offset Options
|
||||
*/
|
||||
offset?: OffsetOption;
|
||||
|
||||
/**
|
||||
* 'left', 'right', or 'center'
|
||||
*/
|
||||
align?: AlignType;
|
||||
|
||||
/**
|
||||
* Integer
|
||||
*/
|
||||
width?: number;
|
||||
|
||||
/**
|
||||
* Time while the message will be displayed. It's not equivalent to the *demo* timeOut!
|
||||
*/
|
||||
delay?: number;
|
||||
|
||||
/**
|
||||
* If true then will display a cross to close the popup.
|
||||
*/
|
||||
allow_dismiss?: boolean;
|
||||
|
||||
/**
|
||||
* Spacing between consecutively stacked growls.
|
||||
*/
|
||||
stackup_spacing?: number;
|
||||
}
|
||||
}
|
||||
interface JQueryStatic {
|
||||
/**
|
||||
* Show standard Bootstrap alerts into hovering "Growl-like" notifications
|
||||
* @param message to show.
|
||||
* @param options should be an options object.
|
||||
* @returns The element.
|
||||
*/
|
||||
bootstrapGrowl: (message: string, options?: BootstrapGrowlIfightcrime.Options) => JQuery;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"bootstrap-growl-ifightcrime-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"extends": "dtslint/dt.json"}
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
// Type definitions for jquery-awesome-cursor 0.3
|
||||
// Project: https://jwarby.github.io/jquery-awesome-cursor
|
||||
// Definitions by: Zsolt Kovács <https://github.com/zskovacs>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
/// <reference types="jquery" />
|
||||
declare namespace JQueryAwesomeCursor {
|
||||
type flip = "horizontal" | "vertical" | "both";
|
||||
type cssHandler = (name: string) => void;
|
||||
|
||||
interface Options {
|
||||
color?: string;
|
||||
size?: number;
|
||||
hotspot?: number[] | string;
|
||||
flip?: flip;
|
||||
rotate?: number;
|
||||
outline?: string;
|
||||
font?: Font;
|
||||
}
|
||||
|
||||
interface Font {
|
||||
family: string;
|
||||
cssClass: string | cssHandler;
|
||||
}
|
||||
}
|
||||
|
||||
interface JQueryStatic {
|
||||
awesomeCursor(icon: string, options?: JQueryAwesomeCursor.Options): JQuery;
|
||||
}
|
||||
|
||||
interface JQuery {
|
||||
awesomeCursor(icon: string, options?: JQueryAwesomeCursor.Options): JQuery;
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
// Default
|
||||
jQuery.awesomeCursor('pencil');
|
||||
|
||||
// Color
|
||||
jQuery.awesomeCursor('pencil', {
|
||||
color: '#ff0000'
|
||||
});
|
||||
|
||||
// Size
|
||||
jQuery.awesomeCursor('pencil', {
|
||||
size: 32
|
||||
});
|
||||
|
||||
// Hotspot
|
||||
jQuery.awesomeCursor('pencil', {
|
||||
hotspot: [0, 17]
|
||||
});
|
||||
jQuery.awesomeCursor('pencil', {
|
||||
hotspot: 'bottom left'
|
||||
});
|
||||
|
||||
// Flip
|
||||
jQuery.awesomeCursor('pencil', {
|
||||
flip: 'horizontal'
|
||||
});
|
||||
jQuery.awesomeCursor('pencil', {
|
||||
flip: 'vertical'
|
||||
});
|
||||
jQuery.awesomeCursor('pencil', {
|
||||
flip: 'both'
|
||||
});
|
||||
|
||||
// Rotate
|
||||
jQuery.awesomeCursor('pencil', {
|
||||
rotate: 45
|
||||
});
|
||||
|
||||
// Outline
|
||||
jQuery.awesomeCursor('pencil', {
|
||||
outline: 'red'
|
||||
});
|
||||
|
||||
// Different font
|
||||
jQuery.awesomeCursor('brush', {
|
||||
font: {
|
||||
family: 'typicons',
|
||||
cssClass: 'typcn typcn-%s'
|
||||
}
|
||||
});
|
||||
jQuery.awesomeCursor('brush', {
|
||||
font: {
|
||||
family: 'typicons',
|
||||
cssClass: (name) => {
|
||||
return 'typcn typcn-' + name;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Mixed
|
||||
jQuery.awesomeCursor('long-arrow-left', {
|
||||
color: 'red',
|
||||
hotspot: 'top left',
|
||||
rotate: 45,
|
||||
});
|
||||
@@ -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",
|
||||
"jquery-awesome-cursor-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Vendored
+4
-1
@@ -1,6 +1,8 @@
|
||||
// Type definitions for jQuery Mask Plugin 1.14
|
||||
// Project: https://igorescobar.github.io/jQuery-Mask-Plugin/
|
||||
// Definitions by: Anže Videnič <https://github.com/avidenic>, Igor Escobar <http://www.igorescobar.com/>
|
||||
// Definitions by: Anže Videnič <https://github.com/avidenic>
|
||||
// Igor Escobar <http://www.igorescobar.com/>
|
||||
// Anderson Friaça <https://github.com/AndersonFriaca>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
@@ -25,6 +27,7 @@ declare namespace jQueryMask {
|
||||
selectOnFocus?: boolean;
|
||||
reverse?: boolean;
|
||||
clearIfNotMatch?: boolean;
|
||||
placeholder?: string;
|
||||
onComplete?(value: string, e: Event, $element: JQuery, options: Options): void;
|
||||
onKeyPress?(value: string, e: Event, $element: JQuery, options: Options): void;
|
||||
onChange?(value: string, e: Event, $element: JQuery, options: Options): void;
|
||||
|
||||
@@ -27,6 +27,9 @@ $(document).ready(() => {
|
||||
placeholder: "__/__/____"
|
||||
}
|
||||
});
|
||||
$('.placeholder2').mask("00/00/0000", {
|
||||
placeholder: "__/__/____"
|
||||
});
|
||||
$('.fallback').mask("00r00r0000", {
|
||||
translation: {
|
||||
r: {
|
||||
|
||||
Vendored
+16
-16
@@ -8,27 +8,27 @@ declare module "../index" {
|
||||
* @param arrays The arrays to process.
|
||||
* @return Returns the new array of grouped elements.
|
||||
*/
|
||||
zip<T1, T2>(arrays1: List<T1>, arrays2: List<T2>): Array<[T1, T2]>;
|
||||
zip<T1, T2>(arrays1: List<T1>, arrays2: List<T2>): Array<[T1 | undefined, T2 | undefined]>;
|
||||
|
||||
/**
|
||||
* @see _.zip
|
||||
*/
|
||||
zip<T1, T2, T3>(arrays1: List<T1>, arrays2: List<T2>, arrays3: List<T3>): Array<[T1, T2, T3]>;
|
||||
zip<T1, T2, T3>(arrays1: List<T1>, arrays2: List<T2>, arrays3: List<T3>): Array<[T1 | undefined, T2 | undefined, T3 | undefined]>;
|
||||
|
||||
/**
|
||||
* @see _.zip
|
||||
*/
|
||||
zip<T1, T2, T3, T4>(arrays1: List<T1>, arrays2: List<T2>, arrays3: List<T3>, arrays4: List<T4>): Array<[T1, T2, T3, T4]>;
|
||||
zip<T1, T2, T3, T4>(arrays1: List<T1>, arrays2: List<T2>, arrays3: List<T3>, arrays4: List<T4>): Array<[T1 | undefined, T2 | undefined, T3 | undefined, T4 | undefined]>;
|
||||
|
||||
/**
|
||||
* @see _.zip
|
||||
*/
|
||||
zip<T1, T2, T3, T4, T5>(arrays1: List<T1>, arrays2: List<T2>, arrays3: List<T3>, arrays4: List<T4>, arrays5: List<T5>): Array<[T1, T2, T3, T4, T5]>;
|
||||
zip<T1, T2, T3, T4, T5>(arrays1: List<T1>, arrays2: List<T2>, arrays3: List<T3>, arrays4: List<T4>, arrays5: List<T5>): Array<[T1 | undefined, T2 | undefined, T3 | undefined, T4 | undefined, T5 | undefined]>;
|
||||
|
||||
/**
|
||||
* @see _.zip
|
||||
*/
|
||||
zip<T>(...arrays: Array<List<T> | null | undefined>): T[][];
|
||||
zip<T>(...arrays: Array<List<T> | null | undefined>): (T | undefined)[][];
|
||||
}
|
||||
|
||||
interface LoDashImplicitWrapper<TValue> {
|
||||
@@ -38,7 +38,7 @@ declare module "../index" {
|
||||
zip<T1, T2>(
|
||||
this: LoDashImplicitWrapper<List<T1>>,
|
||||
arrays2: List<T2>,
|
||||
): LoDashImplicitWrapper<Array<[T1, T2]>>;
|
||||
): LoDashImplicitWrapper<Array<[T1 | undefined, T2 | undefined]>>;
|
||||
|
||||
/**
|
||||
* @see _.zip
|
||||
@@ -47,7 +47,7 @@ declare module "../index" {
|
||||
this: LoDashImplicitWrapper<List<T1>>,
|
||||
arrays2: List<T2>,
|
||||
arrays3: List<T3>,
|
||||
): LoDashImplicitWrapper<Array<[T1, T2, T3]>>;
|
||||
): LoDashImplicitWrapper<Array<[T1 | undefined, T2 | undefined, T3 | undefined]>>;
|
||||
|
||||
/**
|
||||
* @see _.zip
|
||||
@@ -57,7 +57,7 @@ declare module "../index" {
|
||||
arrays2: List<T2>,
|
||||
arrays3: List<T3>,
|
||||
arrays4: List<T4>,
|
||||
): LoDashImplicitWrapper<Array<[T1, T2, T3, T4]>>;
|
||||
): LoDashImplicitWrapper<Array<[T1 | undefined, T2 | undefined, T3 | undefined, T4 | undefined]>>;
|
||||
|
||||
/**
|
||||
* @see _.zip
|
||||
@@ -68,7 +68,7 @@ declare module "../index" {
|
||||
arrays3: List<T3>,
|
||||
arrays4: List<T4>,
|
||||
arrays5: List<T5>,
|
||||
): LoDashImplicitWrapper<Array<[T1, T2, T3, T4, T5]>>;
|
||||
): LoDashImplicitWrapper<Array<[T1 | undefined, T2 | undefined, T3 | undefined, T4 | undefined, T5 | undefined]>>;
|
||||
|
||||
/**
|
||||
* @see _.zip
|
||||
@@ -76,7 +76,7 @@ declare module "../index" {
|
||||
zip<T>(
|
||||
this: LoDashImplicitWrapper<List<T> | null | undefined>,
|
||||
...arrays: Array<List<T> | null | undefined>
|
||||
): LoDashImplicitWrapper<T[][]>;
|
||||
): LoDashImplicitWrapper<Array<Array<T | undefined>>>;
|
||||
}
|
||||
|
||||
interface LoDashExplicitWrapper<TValue> {
|
||||
@@ -86,7 +86,7 @@ declare module "../index" {
|
||||
zip<T1, T2>(
|
||||
this: LoDashExplicitWrapper<List<T1>>,
|
||||
arrays2: List<T2>,
|
||||
): LoDashExplicitWrapper<Array<[T1, T2]>>;
|
||||
): LoDashExplicitWrapper<Array<[T1 | undefined, T2 | undefined]>>;
|
||||
|
||||
/**
|
||||
* @see _.zip
|
||||
@@ -95,7 +95,7 @@ declare module "../index" {
|
||||
this: LoDashExplicitWrapper<List<T1>>,
|
||||
arrays2: List<T2>,
|
||||
arrays3: List<T3>,
|
||||
): LoDashExplicitWrapper<Array<[T1, T2, T3]>>;
|
||||
): LoDashExplicitWrapper<Array<[T1 | undefined, T2 | undefined, T3 | undefined]>>;
|
||||
|
||||
/**
|
||||
* @see _.zip
|
||||
@@ -105,7 +105,7 @@ declare module "../index" {
|
||||
arrays2: List<T2>,
|
||||
arrays3: List<T3>,
|
||||
arrays4: List<T4>,
|
||||
): LoDashExplicitWrapper<Array<[T1, T2, T3, T4]>>;
|
||||
): LoDashExplicitWrapper<Array<[T1 | undefined, T2 | undefined, T3 | undefined, T4 | undefined]>>;
|
||||
|
||||
/**
|
||||
* @see _.zip
|
||||
@@ -116,7 +116,7 @@ declare module "../index" {
|
||||
arrays3: List<T3>,
|
||||
arrays4: List<T4>,
|
||||
arrays5: List<T5>,
|
||||
): LoDashExplicitWrapper<Array<[T1, T2, T3, T4, T5]>>;
|
||||
): LoDashExplicitWrapper<Array<[T1 | undefined, T2 | undefined, T3 | undefined, T4 | undefined, T5 | undefined]>>;
|
||||
|
||||
/**
|
||||
* @see _.zip
|
||||
@@ -124,6 +124,6 @@ declare module "../index" {
|
||||
zip<T>(
|
||||
this: LoDashExplicitWrapper<List<T> | null | undefined>,
|
||||
...arrays: Array<List<T> | null | undefined>
|
||||
): LoDashExplicitWrapper<T[][]>;
|
||||
): LoDashExplicitWrapper<Array<Array<T | undefined>>>;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3197,43 +3197,52 @@ namespace TestXor {
|
||||
let list: _.List<TResult> | null | undefined = [] as any;
|
||||
|
||||
{
|
||||
let result: TResult[][];
|
||||
// $ExpectType (TResult | undefined)[][]
|
||||
_.zip<TResult>(array);
|
||||
// $ExpectType (TResult | undefined)[][]
|
||||
_.zip<TResult>(array, list);
|
||||
// $ExpectType (TResult | undefined)[][]
|
||||
_.zip<TResult>(array, list, array);
|
||||
|
||||
result = _.zip<TResult>(array);
|
||||
result = _.zip<TResult>(array, list);
|
||||
result = _.zip<TResult>(array, list, array);
|
||||
// $ExpectType (TResult | undefined)[][]
|
||||
_.zip<TResult>(list);
|
||||
// $ExpectType (TResult | undefined)[][]
|
||||
_.zip<TResult>(list, array);
|
||||
// $ExpectType (TResult | undefined)[][]
|
||||
_.zip<TResult>(list, array, list);
|
||||
|
||||
result = _.zip<TResult>(list);
|
||||
result = _.zip<TResult>(list, array);
|
||||
result = _.zip<TResult>(list, array, list);
|
||||
|
||||
result = _.zip(list, array, list, array, list, array);
|
||||
// $ExpectType (TResult | undefined)[][]
|
||||
_.zip(list, array, list, array, list, array);
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashImplicitArrayWrapper<TResult[]>;
|
||||
// $ExpectType LoDashImplicitWrapper<(TResult | undefined)[][]>
|
||||
_(array).zip<TResult>(list);
|
||||
// $ExpectType LoDashImplicitWrapper<(TResult | undefined)[][]>
|
||||
_(array).zip<TResult>(list, array);
|
||||
|
||||
result = _(array).zip<TResult>(list);
|
||||
result = _(array).zip<TResult>(list, array);
|
||||
|
||||
result = _(list).zip<TResult>(array);
|
||||
result = _(list).zip<TResult>(array, list);
|
||||
// $ExpectType LoDashImplicitWrapper<(TResult | undefined)[][]>
|
||||
_(list).zip<TResult>(array);
|
||||
// $ExpectType LoDashImplicitWrapper<(TResult | undefined)[][]>
|
||||
_(list).zip<TResult>(array, list);
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashExplicitArrayWrapper<TResult[]>;
|
||||
// $ExpectType LoDashExplicitWrapper<(TResult | undefined)[][]>
|
||||
_(array).chain().zip<TResult>(list);
|
||||
// $ExpectType LoDashExplicitWrapper<(TResult | undefined)[][]>
|
||||
_(array).chain().zip<TResult>(list, array);
|
||||
|
||||
result = _(array).chain().zip<TResult>(list);
|
||||
result = _(array).chain().zip<TResult>(list, array);
|
||||
|
||||
result = _(list).chain().zip<TResult>(array);
|
||||
result = _(list).chain().zip<TResult>(array, list);
|
||||
// $ExpectType LoDashExplicitWrapper<(TResult | undefined)[][]>
|
||||
_(list).chain().zip<TResult>(array);
|
||||
// $ExpectType LoDashExplicitWrapper<(TResult | undefined)[][]>
|
||||
_(list).chain().zip<TResult>(array, list);
|
||||
}
|
||||
|
||||
{
|
||||
_.zip([1, 2], [3, 4]); // $ExpectType [number, number][]
|
||||
_.zip([1, 2], ["a", "b"]); // $ExpectType [number, string][]
|
||||
_.zip([1, 2], ["a", "b"], [true, false]); // $ExpectType [number, string, boolean][]
|
||||
_.zip([1, 2], [3, 4]); // $ExpectType [number | undefined, number | undefined][]
|
||||
_.zip([1, 2], ["a", "b"]); // $ExpectType [number | undefined, string | undefined][]
|
||||
_.zip([1, 2], ["a", "b"], [true, false]); // $ExpectType [number | undefined, string | undefined, boolean | undefined][]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Vendored
+10
@@ -3237,6 +3237,16 @@ declare module paper {
|
||||
* Deselects all selected items in the project.
|
||||
*/
|
||||
deselectAll(): void;
|
||||
|
||||
/**
|
||||
* Adds the specified layer at the end of the this project’s layers list.
|
||||
*/
|
||||
addLayer(layer: Layer): Layer;
|
||||
|
||||
/**
|
||||
* Inserts the specified layer at the specified index in this project’s layers list.
|
||||
*/
|
||||
insertLayer(index: number, layer: Layer): Layer;
|
||||
|
||||
/**
|
||||
* Perform a hit-test on the items contained within the project at the location of the specified point.
|
||||
|
||||
+2
@@ -46,6 +46,8 @@ export function date(name: string, value?: Date): Date;
|
||||
|
||||
export function array<T>(name: string, value: T[], separator?: string): T[];
|
||||
|
||||
export function button(name: string, handler: () => any): void;
|
||||
|
||||
export interface WrapStoryProps {
|
||||
context?: object;
|
||||
storyFn?: RenderFunction;
|
||||
|
||||
@@ -11,6 +11,7 @@ import {
|
||||
select,
|
||||
date,
|
||||
array,
|
||||
button,
|
||||
knob,
|
||||
} from '@storybook/addon-knobs';
|
||||
|
||||
@@ -58,6 +59,8 @@ stories.add('with all knobs', () => {
|
||||
|
||||
const genericKnob: X = knob<X>('Some generic knob', { value: 'a', type: 'text' });
|
||||
|
||||
button('Some button', () => console.log('Button knob clicked'));
|
||||
|
||||
const style = {
|
||||
...customStyle,
|
||||
fontWeight: bold ? 800 as 800 : 400 as 400, // tslint:disable-line no-unnecessary-type-assertion
|
||||
|
||||
Reference in New Issue
Block a user