UNPKG

@stylexswc/rs-compiler

Version:

NAPI-RS compiler for transform StyleX code

85 lines (77 loc) 2.35 kB
/* auto-generated by NAPI-RS */ /* eslint-disable */ export interface ImportSourceInput { as: string from: string } export declare const enum PropertyValidationMode { Throw = 'throw', Warn = 'warn', Silent = 'silent' } export declare const enum SourceMaps { True = 'True', False = 'False', Inline = 'Inline' } export interface StyleXMetadata { stylex: ([string, { ltr: string; rtl?: null | string }, number])[] } export interface StyleXModuleResolution { type: string rootDir?: string themeFileExtension?: string } export interface StyleXOptions { styleResolution?: 'application-order' | 'property-specificity' | 'legacy-expand-shorthands' enableFontSizePxToRem?: boolean runtimeInjection?: boolean | string classNamePrefix?: string definedStylexCssVariables?: Record<string, string> importSources?: (string | { as: string, from: string })[] treeshakeCompensation?: boolean enableInlinedConditionalMerge?: boolean enableMediaQueryOrder?: boolean enableLogicalStylesPolyfill?: boolean enableLegacyValueFlipping?: boolean enableLTRRTLComments?: boolean legacyDisableLayers?: boolean dev?: boolean test?: boolean debug?: boolean enableDebugClassNames?: boolean enableDebugDataProp?: boolean enableDevClassNames?: boolean enableMinifiedKeys?: boolean injectStylexSideEffects?: boolean useRealFileForSource?: boolean aliases?: Record<string, string[]> unstable_moduleResolution?: StyleXModuleResolution sourceMap?: SourceMaps propertyValidationMode?: 'throw' | 'warn' | 'silent' /** Compile-time constants and functions accessible via `stylex.env`. */ env?: Record<string, any> /** * Optional function or string to transform file paths used in debug class * names / source maps. */ debugFilePath?: ((filePath: string) => string) | string | undefined /** * The prop name to use as the `sx` shorthand (default: `"sx"`). Set to * `false` to disable. */ sxPropName?: string | false } export interface StyleXTransformResult { code: string metadata: StyleXMetadata map?: string } export declare function transform(filename: string, code: string, options: StyleXOptions): StyleXTransformResult export interface TransformOutput { code: string map?: string output?: string extractedComments?: Array<string> diagnostics: Array<string> }