UNPKG

get-sass-vars

Version:

Get Sass variables as JSON object.

49 lines 1.61 kB
export default main; export type JsonValue = JsonPrimitive | JsonObject | JsonValue[]; export type JsonArray = JsonValue[]; export type JsonPrimitive = string | number | boolean | null; export type JsonObject = { [x: string]: JsonValue | undefined; }; export type Options = { /** * Camelize first-level JSON object keys and strip inital `$` (e.g. `$foo-bar` will become `fooBar`). */ camelize?: boolean | undefined; /** * Options for Sass renderer. */ sassOptions?: import("sass").Options<"async"> | undefined; }; export type SyncOptions = { /** * Camelize first-level JSON object keys and strip inital `$` (e.g. `$foo-bar` will become `fooBar`). */ camelize?: boolean | undefined; /** * Options for Sass renderer. */ sassOptions?: import("sass").Options<"sync"> | undefined; }; /** * Gets Sass variables from Sass string. * * Only top-level variables will be considered, anything inside selector or at-rule is ignored. * * @param {string} input Sass input string. * @param {Options=} options */ declare function main(input: string, options?: Options | undefined): Promise<JsonObject>; declare namespace main { export { mainSync as sync }; } /** * Gets Sass variables from Sass string. Sync version. * * Only top-level variables will be considered, anything inside selector or at-rule is ignored. * * @param {string} input Sass input string. * @param {SyncOptions=} options */ declare function mainSync(input: string, options?: SyncOptions | undefined): JsonObject; //# sourceMappingURL=index.d.ts.map