Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions types/raphael/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -456,11 +456,13 @@ export type RaphaelPaperPluginRegistry<
/**
* Either the paper plugin method or a new namespace with methods.
*/
[P in keyof T]: T[P] extends (...args: any) => any
? RaphaelPaperPluginMethod<TTechnology, Parameters<T[P]>, ReturnType<T[P]>>
: RaphaelPaperPluginRegistry<TTechnology, T[P]>;
[P in keyof T]: RaphaelPaperPluginMethodOrRegistry<TTechnology, T[P]>;
};

type RaphaelPaperPluginMethodOrRegistry<TTechnology extends RaphaelTechnology, T> =
T extends (...args: any) => any
? RaphaelPaperPluginMethod<TTechnology, Parameters<T>, ReturnType<T>>
: RaphaelPaperPluginRegistry<TTechnology, T>;
/**
* You can add your own method to elements. This is useful when you want to hack default functionality or want
* to wrap some common transformation or attributes in one method. In contrast to canvas methods, you can
Expand Down