UNPKG

eyeglass

Version:
79 lines 4.88 kB
/// <reference types="node" /> import type * as sass from "node-sass"; export type { Options } from "node-sass"; declare type SassValue = sass.types.Value; declare type SassString = sass.types.String; declare type SassColor = sass.types.Color; declare type SassNumber = sass.types.Number; declare type SassBoolean = sass.types.Boolean; declare type SassNull = sass.types.Null; declare type SassError = sass.types.Error; declare type SassMap = sass.types.Map; declare type SassList = sass.types.List; export declare function isSassValue(sass: SassImplementation, value: unknown): value is sass.types.Value; export declare function inspect(sass: SassImplementation, value: SassValue): string; export declare function isSassNumber(sass: SassImplementation, value: unknown): value is SassNumber; export declare function isSassString(sass: SassImplementation, value: unknown): value is SassString; export declare function isSassColor(sass: SassImplementation, value: unknown): value is SassColor; export declare function isSassBoolean(sass: SassImplementation, value: unknown): value is SassBoolean; export declare function isSassNull(sass: SassImplementation, value: unknown): value is SassNull; export declare function isSassList(sass: SassImplementation, value: unknown): value is SassList; export declare function isSassMap(sass: SassImplementation, value: unknown): value is SassMap; export declare function isSassMapOrEmptyList(sass: SassImplementation, value: unknown): value is SassMap | SassList; export declare function isSassError(sass: SassImplementation, value: unknown): value is SassError; export declare type SassImplementation = typeof sass; export declare function isSassImplementation(impl: unknown): impl is SassImplementation; declare const typeGuards: { null: typeof isSassNull; string: typeof isSassString; number: typeof isSassNumber; map: typeof isSassMapOrEmptyList; list: typeof isSassList; color: typeof isSassColor; boolean: typeof isSassBoolean; error: typeof isSassError; }; interface SassType { null: SassNull; string: SassString; number: SassNumber; map: SassMap | SassList; list: SassList; color: SassColor; boolean: SassBoolean; error: SassError; } declare type SassTypeName = keyof typeof typeGuards; export declare function isType<Name extends SassTypeName>(sass: SassImplementation, value: SassValue | SassError, name: Name): value is SassType[Name]; export declare function typeError(sass: SassImplementation, expected: SassTypeName, actual: SassTypeName | SassValue): SassError; export declare class SassTypeError extends Error { constructor(sass: SassImplementation, expected: SassTypeName, actual: SassTypeName | SassValue); } export declare function helpers(sass: SassImplementation): { isSass: (value: unknown) => value is typeof import("node-sass"); isNull: (value: unknown) => value is sass.types.Null; isString: (value: unknown) => value is sass.types.String; isNumber: (value: unknown) => value is sass.types.Number; isMap: (value: unknown) => value is sass.types.Map; isList: (value: unknown) => value is sass.types.List; isColor: (value: unknown) => value is sass.types.Color; isBoolean: (value: unknown) => value is sass.types.Boolean; isError: (value: unknown) => value is sass.types.Error; isValue: (value: unknown) => value is sass.types.Value; isMapOrEmptyList: (value: unknown) => value is sass.types.List | sass.types.Map; typeError: (expected: "string" | "number" | "boolean" | "error" | "null" | "map" | "list" | "color", actual: "string" | "number" | "boolean" | "error" | sass.types.Null | sass.types.Number | sass.types.String | sass.types.Color | sass.types.Boolean | sass.types.List | sass.types.Map | "null" | "map" | "list" | "color") => sass.types.Error; isType: (value: sass.types.ReturnValue, name: "string" | "number" | "boolean" | "error" | "null" | "map" | "list" | "color") => boolean; typeName: (value: sass.types.ReturnValue) => "string" | "number" | "boolean" | "error" | "null" | "map" | "list" | "color"; inspect: (value: sass.types.Value) => string; TypeError: { new (expected: "string" | "number" | "boolean" | "error" | "null" | "map" | "list" | "color", actual: "string" | "number" | "boolean" | "error" | sass.types.Null | sass.types.Number | sass.types.String | sass.types.Color | sass.types.Boolean | sass.types.List | sass.types.Map | "null" | "map" | "list" | "color"): { name: string; message: string; stack?: string | undefined; }; captureStackTrace(targetObject: Object, constructorOpt?: Function | undefined): void; prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined; stackTraceLimit: number; }; }; //# sourceMappingURL=SassImplementation.d.ts.map