-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add stylis plugin TS Type definitions
- Loading branch information
1 parent
52ab079
commit 4c8210c
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |