mirror of
https://github.com/bendtherules/completion-viz.git
synced 2026-08-18 13:42:51 +00:00
update(types): Expose more types from prism
This commit is contained in:
@@ -3,3 +3,49 @@ export type Token = {
|
|||||||
content: string;
|
content: string;
|
||||||
empty?: boolean;
|
empty?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export type RenderProps = {
|
||||||
|
tokens: Token[][];
|
||||||
|
className: string;
|
||||||
|
style: StyleObj;
|
||||||
|
getLineProps: (input: LineInputProps) => LineOutputProps;
|
||||||
|
getTokenProps: (input: TokenInputProps) => TokenOutputProps;
|
||||||
|
};
|
||||||
|
|
||||||
|
export type StyleObj = {
|
||||||
|
[key: string]: string | number | null;
|
||||||
|
};
|
||||||
|
|
||||||
|
export type LineInputProps = {
|
||||||
|
key?: React.Key;
|
||||||
|
style?: StyleObj;
|
||||||
|
className?: string;
|
||||||
|
line: Token[];
|
||||||
|
[otherProp: string]: any;
|
||||||
|
};
|
||||||
|
|
||||||
|
export type LineOutputProps = {
|
||||||
|
key?: React.Key;
|
||||||
|
style?: StyleObj;
|
||||||
|
className: string;
|
||||||
|
[otherProps: string]: any;
|
||||||
|
};
|
||||||
|
|
||||||
|
export type TokenInputProps = {
|
||||||
|
key?: React.Key;
|
||||||
|
style?: StyleObj;
|
||||||
|
className?: string;
|
||||||
|
token: Token;
|
||||||
|
[otherProp: string]: any;
|
||||||
|
};
|
||||||
|
|
||||||
|
export type TokenOutputProps = {
|
||||||
|
key?: React.Key;
|
||||||
|
style?: StyleObj;
|
||||||
|
className: string;
|
||||||
|
children: string;
|
||||||
|
[otherProp: string]: any;
|
||||||
|
};
|
||||||
|
|
||||||
|
export type TgetLineProps = (input: LineInputProps) => LineOutputProps;
|
||||||
|
export type TgetTokenProps = (input: TokenInputProps) => TokenOutputProps;
|
||||||
|
|||||||
Reference in New Issue
Block a user