Skip to content

Commit

Permalink
fix: add stylis plugin TS Type definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
tujoworker committed Jan 31, 2022
1 parent 52ab079 commit 4c8210c
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions packages/dnb-eufemia/src/style/stylis.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
export interface StylisElement {
type: string;
value: string;
props: Array<string> | string;
root: StylisElement | null;
parent: StylisElement | null;
children: Array<StylisElement> | string;
line: number;
column: number;
length: number;
return: string;
}
export type StylisPluginCallback = (
element: StylisElement,
index: number,
children: Array<StylisElement>,
callback: StylisPluginCallback
) => string | void;

export type StylisPlugin = (
element: StylisElement,
index: number,
children: Array<StylisElement>,
callback: StylisPluginCallback
) => string | void;

export interface Options {
nonce?: string;
stylisPlugins?: Array<StylisPlugin>;
key: string;
container?: HTMLElement;
speedy?: boolean;
prepend?: boolean;
}

export type Properties = Record<string, unknown>;

export function withProperties(properties: Properties): StylisPlugin;

0 comments on commit 4c8210c

Please sign in to comment.