@styn/plugin-tokenizer
Version:
Create tokens to use in your styn styles
32 lines (31 loc) • 911 B
TypeScript
export declare type Keyword = string;
export declare type Selector = string;
export declare type Declarations = {
[property: string]: number | string | Declarations;
};
export declare type Rule = {
type: "rule";
selector: Selector;
declarations: Declarations;
};
export declare type AtRule = {
type: "at-rule";
keyword: Keyword;
values?: string[];
declarations?: Declarations;
rules?: Rule[];
};
export declare type StynRule = Rule | AtRule;
export declare type StynTree = {
rules: StynRule[];
meta: {
[k: string]: any;
[k: number]: any;
};
};
export declare const stringify: (tree: StynTree) => string;
export declare const parse: (object: {
[k: string]: any;
}) => StynTree;
export declare type StynWalk = (tree: StynTree, callback: (r: StynRule, parent: StynRule[], index: number) => void) => StynTree;
export declare const walk: StynWalk;