mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-06-02 19:43:20 +08:00
Make SnapSVG accessible from WebPack
I have to add export = Snap to make project accessible from projects which using webpack, mina object was not accessibly now, but in runtime it was still perfectly fine to have it in the code. Thus I extract mina package as separate global dependency. For code which use SnapSVG as global dependency this will work as earlier, but for those who want to use SnapSVG with WebPack it will reflect how mina available after importing SnapSVG
This commit is contained in:
50
types/mina/index.d.ts
vendored
Normal file
50
types/mina/index.d.ts
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
// Type definitions for mina Snap-SVG 0.4.1
|
||||
// Project: https://github.com/adobe-webplatform/Snap.svg
|
||||
// Definitions by: Lars Klein <https://github.com/lhk>, Mattanja Kern <https://github.com/mattanja>, Andrey Kurdyumov <https://github.com/kant2002>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare function mina(a:number, A:number, b:number, B:number, get:Function, set:Function, easing?:(num:number)=>number):mina.AnimationDescriptor;
|
||||
declare namespace mina {
|
||||
export interface MinaAnimation {
|
||||
id: string;
|
||||
duration: Function;
|
||||
easing: Function;
|
||||
speed: Function;
|
||||
status: Function;
|
||||
stop: Function;
|
||||
}
|
||||
|
||||
export interface AnimationDescriptor {
|
||||
id: string;
|
||||
start: number;
|
||||
end: number;
|
||||
b: number;
|
||||
s: number;
|
||||
dur: number;
|
||||
spd: number;
|
||||
get(): number;
|
||||
set(slave: number): number;
|
||||
easing(input: number): number;
|
||||
status(): number;
|
||||
status(newStatus: number): void;
|
||||
speed(): number;
|
||||
speed(newSpeed: number): void;
|
||||
duration(): number;
|
||||
duration(newDuration: number): void;
|
||||
stop(): void;
|
||||
pause(): void;
|
||||
resume(): void;
|
||||
update(): void;
|
||||
}
|
||||
|
||||
export function backin(n:number):number;
|
||||
export function backout(n:number):number;
|
||||
export function bounce(n:number):number;
|
||||
export function easein(n:number):number;
|
||||
export function easeinout(n:number):number;
|
||||
export function easeout(n:number):number;
|
||||
export function elastic(n:number):number;
|
||||
export function getById(id:string):AnimationDescriptor;
|
||||
export function linear(n:number):number;
|
||||
export function time():number;
|
||||
}
|
||||
21
types/mina/tsconfig.json
Normal file
21
types/mina/tsconfig.json
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts"
|
||||
]
|
||||
}
|
||||
1
types/mina/tslint.json
Normal file
1
types/mina/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
50
types/snapsvg/index.d.ts
vendored
50
types/snapsvg/index.d.ts
vendored
@@ -1,53 +1,11 @@
|
||||
// Type definitions for Snap-SVG 0.4.1
|
||||
// Project: https://github.com/adobe-webplatform/Snap.svg
|
||||
// Definitions by: Lars Klein <https://github.com/lhk>, Mattanja Kern <https://github.com/mattanja>
|
||||
// Definitions by: Lars Klein <https://github.com/lhk>, Mattanja Kern <https://github.com/mattanja>, Andrey Kurdyumov <https://github.com/kant2002>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
/// <reference types="mina" />
|
||||
|
||||
declare function mina(a:number, A:number, b:number, B:number, get:Function, set:Function, easing?:(num:number)=>number):mina.AnimationDescriptor;
|
||||
declare namespace mina {
|
||||
export interface MinaAnimation {
|
||||
id: string;
|
||||
duration: Function;
|
||||
easing: Function;
|
||||
speed: Function;
|
||||
status: Function;
|
||||
stop: Function;
|
||||
}
|
||||
|
||||
export interface AnimationDescriptor {
|
||||
id: string;
|
||||
start: number;
|
||||
end: number;
|
||||
b: number;
|
||||
s: number;
|
||||
dur: number;
|
||||
spd: number;
|
||||
get(): number;
|
||||
set(slave: number): number;
|
||||
easing(input: number): number;
|
||||
status(): number;
|
||||
status(newStatus: number): void;
|
||||
speed(): number;
|
||||
speed(newSpeed: number): void;
|
||||
duration(): number;
|
||||
duration(newDuration: number): void;
|
||||
stop(): void;
|
||||
pause(): void;
|
||||
resume(): void;
|
||||
update(): void;
|
||||
}
|
||||
|
||||
export function backin(n:number):number;
|
||||
export function backout(n:number):number;
|
||||
export function bounce(n:number):number;
|
||||
export function easein(n:number):number;
|
||||
export function easeinout(n:number):number;
|
||||
export function easeout(n:number):number;
|
||||
export function elastic(n:number):number;
|
||||
export function getById(id:string):AnimationDescriptor;
|
||||
export function linear(n:number):number;
|
||||
export function time():number;
|
||||
}
|
||||
export = Snap;
|
||||
export as namespace Snap;
|
||||
|
||||
declare function Snap(width:number|string,height:number|string):Snap.Paper;
|
||||
declare function Snap(query:string):Snap.Paper;
|
||||
|
||||
@@ -22,4 +22,4 @@
|
||||
"test/2.ts",
|
||||
"test/3.ts"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user