diff options
author | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2020-06-01 18:14:34 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-01 18:14:34 +1000 |
commit | 5bd6906f48ad528cb3d3ee980c5bd537b703d953 (patch) | |
tree | c686546c3cc19afd56970aeef7ca3d84d98f8e8c /svg.js.d.ts | |
parent | 09ad1754ae8e8962272d6b68742abe783f2f5b8a (diff) | |
parent | f9055655cec603e2cb7d01c2307a1eafab1b3f2e (diff) | |
download | svg.js-5bd6906f48ad528cb3d3ee980c5bd537b703d953.tar.gz svg.js-5bd6906f48ad528cb3d3ee980c5bd537b703d953.zip |
Merge branch 'master' into some-more-typings
Diffstat (limited to 'svg.js.d.ts')
-rw-r--r-- | svg.js.d.ts | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/svg.js.d.ts b/svg.js.d.ts index 5b7b3fa..2264c66 100644 --- a/svg.js.d.ts +++ b/svg.js.d.ts @@ -4,6 +4,9 @@ // trick to keep reference to Array build-in type
declare class BuiltInArray<T> extends Array<T> { }
+// trick to have nice attribute list for CSS
+declare type CSSStyleName = Exclude<keyof CSSStyleDeclaration, "parentRule" | "length" >
+
declare module "@svgdotjs/svg.js" {
function SVG(): Svg;
@@ -771,11 +774,19 @@ declare module "@svgdotjs/svg.js" { }
// Timeline.js
+ interface ScheduledRunnerInfo {
+ start: number
+ duration: number
+ end: number
+ runner: Runner
+ }
+
class Timeline extends EventTarget {
constructor()
constructor(fn: Function)
- schedule(runner?: Runner, delay?: number, when?: string): this
+ schedule(runner: Runner, delay?: number, when?: string): this
+ schedule(): ScheduledRunnerInfo[]
unschedule(runner: Runner): this
getEndTime(): number
updateTime(): this
@@ -812,7 +823,6 @@ declare module "@svgdotjs/svg.js" { constructor();
constructor(options: Function);
constructor(options: number);
- constructor(options: object);
constructor(options: Controller);
static sanitise: (duration?: TimeLike, delay?: number, when?: string) => object
@@ -1006,11 +1016,11 @@ declare module "@svgdotjs/svg.js" { toggleClass(name: string): this
// prototype method register in css.js
- css(): object;
- css(style: string): string
- css(style: string[]): object;
- css(style: string, val: any): this
- css(style: object): this
+ css(): Partial<CSSStyleDeclaration>
+ css<T extends CSSStyleName>(style: T): CSSStyleDeclaration[T]
+ css<T extends CSSStyleName[]>(style: T): Partial<CSSStyleDeclaration>
+ css<T extends CSSStyleName>(style: T, val: CSSStyleDeclaration[T]): this
+ css(style: Partial<CSSStyleDeclaration>): this
show(): this
hide(): this
visible(): boolean
|