@bamboocss/shared
Advanced tools
+1
-1
| { | ||
| "name": "@bamboocss/shared", | ||
| "version": "1.12.0", | ||
| "version": "1.12.1", | ||
| "description": "Shared utilities for css bamboo", | ||
@@ -5,0 +5,0 @@ "homepage": "https://bamboo-css.com", |
| //#region src/astish.d.ts | ||
| declare const astish: (val: string, tree?: any[]) => Record<string, any>; | ||
| //#endregion | ||
| export { astish }; |
| //#region src/astish.d.ts | ||
| declare const astish: (val: string, tree?: any[]) => Record<string, any>; | ||
| //#endregion | ||
| export { astish }; |
-284
| //#region src/arbitrary-value.d.ts | ||
| declare const getArbitraryValue: (_value: string) => string; | ||
| //#endregion | ||
| //#region src/assert.d.ts | ||
| declare const isString: (v: any) => v is string; | ||
| declare const isBoolean: (v: any) => v is boolean; | ||
| type AnyFunction = (...args: any[]) => any; | ||
| declare const isFunction: (v: any) => v is AnyFunction; | ||
| declare function isObject(value: any): value is Record<string, any>; | ||
| declare const isSymbol: (v: any) => v is symbol; | ||
| declare const isObjectOrArray: (obj: unknown) => obj is object; | ||
| //#endregion | ||
| //#region src/assign.d.ts | ||
| declare function assign(target: any, ...sources: any[]): any; | ||
| //#endregion | ||
| //#region src/astish.d.ts | ||
| declare const astish: (val: string, tree?: any[]) => Record<string, any>; | ||
| //#endregion | ||
| //#region src/cache-map.d.ts | ||
| declare class CacheMap<K, V> implements Map<K, V> { | ||
| private cache; | ||
| private keysInUse; | ||
| private maxCacheSize; | ||
| constructor(maxCacheSize?: number); | ||
| get(key: K): V | undefined; | ||
| set(key: K, value: V): this; | ||
| delete(key: K): boolean; | ||
| private updateKeyUsage; | ||
| private evictLeastRecentlyUsed; | ||
| clear(): void; | ||
| has(key: K): boolean; | ||
| get size(): number; | ||
| forEach(callback: (value: V, key: K, map: Map<K, V>) => void, thisArg?: any): void; | ||
| keys(): MapIterator<K>; | ||
| values(): MapIterator<V>; | ||
| entries(): MapIterator<[K, V]>; | ||
| getOrInsert(key: K, defaultValue: V): V; | ||
| getOrInsertComputed(key: K, callback: (key: K) => V): V; | ||
| [Symbol.iterator](): MapIterator<[K, V]>; | ||
| [Symbol.toStringTag]: string; | ||
| toJSON: () => Map<K, V>; | ||
| } | ||
| //#endregion | ||
| //#region src/calc.d.ts | ||
| type Operand = string | number | { | ||
| ref: string; | ||
| }; | ||
| declare const calc: { | ||
| negate(x: Operand): string; | ||
| }; | ||
| //#endregion | ||
| //#region src/camelcase-property.d.ts | ||
| declare const camelCaseProperty: (property: string) => string; | ||
| //#endregion | ||
| //#region src/capitalize.d.ts | ||
| declare const capitalize: (s: string) => string; | ||
| declare const dashCase: (s: string) => string; | ||
| declare const uncapitalize: (s: string) => string; | ||
| //#endregion | ||
| //#region src/classname.d.ts | ||
| interface CreateCssContext { | ||
| hash?: boolean; | ||
| grouped?: boolean; | ||
| /** | ||
| * Partial properties from the Utility class | ||
| */ | ||
| utility: { | ||
| prefix: string; | ||
| hasShorthand: boolean; | ||
| resolveShorthand: (prop: string) => string; | ||
| transform: (prop: string, value: any) => { | ||
| className: string; | ||
| }; | ||
| toHash: (path: string[], toHash: (str: string) => string) => string; | ||
| }; | ||
| /** | ||
| * Partial properties from the Condition class | ||
| */ | ||
| conditions?: { | ||
| breakpoints: { | ||
| keys: string[]; | ||
| }; | ||
| shift: (paths: string[]) => string[]; | ||
| finalize: (paths: string[]) => string[]; | ||
| }; | ||
| } | ||
| declare function createCss(context: CreateCssContext): ({ | ||
| base, | ||
| ...styles | ||
| }?: Record<string, any>) => string; | ||
| interface StyleObject { | ||
| [key: string]: any; | ||
| } | ||
| declare function createMergeCss(context: CreateCssContext): { | ||
| mergeCss: (...styles: StyleObject[]) => StyleObject; | ||
| assignCss: (...styles: StyleObject[]) => any; | ||
| }; | ||
| //#endregion | ||
| //#region src/compact.d.ts | ||
| declare function compact<T extends Record<string, any>>(value: T): T; | ||
| //#endregion | ||
| //#region src/condition.d.ts | ||
| declare const isBaseCondition: (v: string) => v is "base"; | ||
| declare function filterBaseConditions(c: string[]): string[]; | ||
| //#endregion | ||
| //#region src/css-var.d.ts | ||
| interface CssVar { | ||
| var: `--${string}`; | ||
| ref: string; | ||
| } | ||
| interface CssVarOptions { | ||
| fallback?: string; | ||
| prefix?: string; | ||
| hash?: boolean; | ||
| } | ||
| declare function cssVar(name: string, options?: CssVarOptions): CssVar; | ||
| //#endregion | ||
| //#region src/deep-set.d.ts | ||
| type Dict$2 = Record<string, any>; | ||
| declare const deepSet: <T extends Dict$2>(target: T, path: string[], value: Dict$2 | string) => T; | ||
| //#endregion | ||
| //#region src/entries.d.ts | ||
| declare function fromEntries<A extends symbol | string | number, B>(entries: [A, B][]): { [key in A]: B }; | ||
| declare function entries<A extends symbol | string | number, B>(obj: { [key in A]: B }): [A, B][]; | ||
| declare function mapEntries<A, B, K extends string | number | symbol>(obj: { [key in K]: A }, f: (key: K, val: A) => [K, B]): { [key in K]: B }; | ||
| //#endregion | ||
| //#region src/error.d.ts | ||
| type BambooErrorCode = 'CONFIG_NOT_FOUND' | 'CONFIG_ERROR' | 'NOT_FOUND' | 'CONDITION' | 'MISSING_STUDIO' | 'INVALID_LAYER' | 'UNKNOWN_RECIPE' | 'INVALID_RECIPE' | 'UNKNOWN_TYPE' | 'UNKNOWN_ARTIFACT' | 'UNKNOWN_LITERAL_TYPE' | 'UNKNOWN_RESULT_TYPE' | 'MISSING_PARAMS' | 'NO_CONTEXT' | 'INVALID_TOKEN'; | ||
| declare class BambooError extends Error { | ||
| readonly code: string; | ||
| readonly hint?: string; | ||
| constructor(code: BambooErrorCode, message: string, opts?: { | ||
| hint?: string; | ||
| cause?: unknown; | ||
| }); | ||
| } | ||
| //#endregion | ||
| //#region src/esc.d.ts | ||
| declare const esc: (sel: string) => string; | ||
| //#endregion | ||
| //#region src/walk-object.d.ts | ||
| type Predicate<R = any> = (value: any, path: string[]) => R; | ||
| type MappedObject<T, K> = { [Prop in keyof T]: T[Prop] extends Array<any> ? MappedObject<T[Prop][number], K>[] : T[Prop] extends Record<string, unknown> ? MappedObject<T[Prop], K> : K }; | ||
| type WalkObjectStopFn = (value: any, path: string[]) => boolean; | ||
| interface WalkObjectOptions { | ||
| stop?: WalkObjectStopFn; | ||
| getKey?(prop: string, value: any): string; | ||
| } | ||
| declare function walkObject<T, K>(target: T, predicate: Predicate<K>, options?: WalkObjectOptions): MappedObject<T, ReturnType<Predicate<K>>>; | ||
| declare function mapObject(obj: any, fn: (value: any) => any): any; | ||
| //#endregion | ||
| //#region src/flatten.d.ts | ||
| declare function flatten(values: Record<string, Record<string, any>>, stop?: WalkObjectStopFn): Record<string, any>; | ||
| //#endregion | ||
| //#region src/get-or-create-set.d.ts | ||
| declare function getOrCreateSet<TKey, TValue>(map: Map<TKey, Set<TValue>>, key: TKey): Set<TValue>; | ||
| //#endregion | ||
| //#region src/hash.d.ts | ||
| declare function toHash(value: string): string; | ||
| //#endregion | ||
| //#region src/hypenate-property.d.ts | ||
| declare const hypenateProperty: (property: string) => string; | ||
| //#endregion | ||
| //#region src/important.d.ts | ||
| declare function isImportant<T extends string | number | boolean>(value: T): boolean; | ||
| declare function withoutImportant<T extends string | number | boolean>(value: T): string | T; | ||
| declare function withoutSpace<T extends string | number | boolean>(str: T): string | T; | ||
| type Dict$1 = Record<string, unknown>; | ||
| declare function markImportant(obj: Dict$1): {}; | ||
| //#endregion | ||
| //#region src/is-css-function.d.ts | ||
| declare const isCssFunction: (v: unknown) => boolean; | ||
| //#endregion | ||
| //#region src/is-css-unit.d.ts | ||
| declare const isCssUnit: (v: unknown) => boolean; | ||
| //#endregion | ||
| //#region src/is-css-var.d.ts | ||
| declare const isCssVar: (v: unknown) => boolean; | ||
| //#endregion | ||
| //#region src/memo.d.ts | ||
| declare const memo: <T extends (...args: any[]) => any>(fn: T) => T; | ||
| //#endregion | ||
| //#region src/merge-anything.d.ts | ||
| /** | ||
| * Credits: https://github.com/mesqueeb/merge-anything | ||
| */ | ||
| declare function mergeAndConcat<T, const Tn extends unknown[]>(object: T, ...otherObjects: Tn): any; | ||
| //#endregion | ||
| //#region src/merge-props.d.ts | ||
| declare function mergeProps<T extends Record<string, unknown>>(...sources: T[]): T; | ||
| //#endregion | ||
| //#region src/merge-with.d.ts | ||
| declare function mergeWith(target: any, ...sources: any[]): any; | ||
| //#endregion | ||
| //#region src/normalize-style-object.d.ts | ||
| type NormalizeContext = Pick<CreateCssContext, 'utility' | 'conditions'>; | ||
| declare function toResponsiveObject(values: string[], breakpoints: string[]): Record<string, string>; | ||
| declare function normalizeStyleObject(styles: Record<string, any>, context: NormalizeContext, shorthand?: boolean): MappedObject<Record<string, any>, any>; | ||
| //#endregion | ||
| //#region src/omit.d.ts | ||
| declare const omit: <T, K extends keyof T | (string & {})>(obj: T, paths: K[]) => Omit<T, K>; | ||
| //#endregion | ||
| //#region src/bamboo-config-name.d.ts | ||
| declare const BAMBOO_CONFIG_NAME: "__bamboo.config__"; | ||
| //#endregion | ||
| //#region src/pattern-fns.d.ts | ||
| declare const patternFns: { | ||
| map: typeof mapObject; | ||
| isCssFunction: (v: unknown) => boolean; | ||
| isCssVar: (v: unknown) => boolean; | ||
| isCssUnit: (v: unknown) => boolean; | ||
| }; | ||
| declare const getPatternStyles: (pattern: any, styles: Record<string, any>) => any; | ||
| //#endregion | ||
| //#region src/pick.d.ts | ||
| declare const pick: <T, K extends keyof T | (string & {})>(obj: T, paths: K[]) => Partial<T>; | ||
| //#endregion | ||
| //#region src/property-priority.d.ts | ||
| declare function getPropertyPriority(key: string): number; | ||
| //#endregion | ||
| //#region src/regex.d.ts | ||
| declare const createRegex: (item: Array<string | RegExp>) => RegExp; | ||
| //#endregion | ||
| //#region src/serialize.d.ts | ||
| declare const stringifyJson: (config: Record<string, any>) => string; | ||
| declare const parseJson: (config: string) => any; | ||
| //#endregion | ||
| //#region src/slot.d.ts | ||
| declare const getSlotRecipes: (recipe?: Record<string, any>) => Record<string, any>; | ||
| declare const getSlotCompoundVariant: <T extends { | ||
| css: any; | ||
| }>(compoundVariants: T[], slotName: string) => (T & { | ||
| css: any; | ||
| })[]; | ||
| //#endregion | ||
| //#region src/split.d.ts | ||
| declare function splitBy(value: string, separator?: string): any[]; | ||
| declare function splitDotPath(path: string): string[]; | ||
| declare function getNegativePath(path: string[]): string[]; | ||
| declare function getDotPath(obj: any, path: string, fallback?: any): any; | ||
| //#endregion | ||
| //#region src/split-props.d.ts | ||
| type Dict = Record<string, unknown>; | ||
| type PredicateFn = (key: string) => boolean; | ||
| type Key = PredicateFn | string[]; | ||
| declare function splitProps(props: Dict, ...keys: Key[]): Dict[]; | ||
| //#endregion | ||
| //#region src/to-json.d.ts | ||
| type MapToRecord<K extends Map<string, any>> = { [P in keyof K]: K[P] extends Map<string, infer V> ? Record<string, V> : never }; | ||
| declare function mapToJson<T extends Map<string, any>>(map: T): MapToRecord<T>; | ||
| //#endregion | ||
| //#region src/traverse.d.ts | ||
| type CallbackFn = (args: CallbackItem) => void; | ||
| interface CallbackItem { | ||
| value: any; | ||
| path: string; | ||
| paths: string[]; | ||
| depth: number; | ||
| parent: any[] | Record<string, unknown>; | ||
| key: string; | ||
| } | ||
| interface TraverseOptions { | ||
| separator?: string; | ||
| maxDepth?: number; | ||
| stop?: (args: CallbackItem) => boolean; | ||
| } | ||
| declare function traverse(obj: any, callback: CallbackFn, options?: TraverseOptions): void; | ||
| //#endregion | ||
| //#region src/typegen.d.ts | ||
| declare function unionType(values: IterableIterator<string> | string[] | readonly string[] | Set<string>, opts?: { | ||
| fallback?: string; | ||
| stringify?: (value: string) => string; | ||
| }): string; | ||
| //#endregion | ||
| //#region src/uniq.d.ts | ||
| declare const uniq: <T>(...items: T[][]) => T[]; | ||
| //#endregion | ||
| //#region src/unit-conversion.d.ts | ||
| declare function getUnit(value?: string): string | undefined; | ||
| declare function toPx(value?: string | number): string | undefined; | ||
| declare function toEm(value?: string, fontSize?: number): string | undefined; | ||
| declare function toRem(value?: string): string | undefined; | ||
| //#endregion | ||
| export { BAMBOO_CONFIG_NAME, BambooError, BambooErrorCode, CacheMap, CreateCssContext, CssVar, CssVarOptions, MapToRecord, MappedObject, WalkObjectOptions, WalkObjectStopFn, assign, astish, calc, camelCaseProperty, capitalize, compact, createCss, createMergeCss, createRegex, cssVar, dashCase, deepSet, entries, esc, filterBaseConditions, flatten, fromEntries, getArbitraryValue, getDotPath, getNegativePath, getOrCreateSet, getPatternStyles, getPropertyPriority, getSlotCompoundVariant, getSlotRecipes, getUnit, hypenateProperty, isBaseCondition, isBoolean, isCssFunction, isCssUnit, isCssVar, isFunction, isImportant, isObject, isObjectOrArray, isString, isSymbol, mapEntries, mapObject, mapToJson, markImportant, memo, mergeAndConcat, mergeProps, mergeWith, normalizeStyleObject, omit, parseJson, patternFns, pick, splitBy, splitDotPath, splitProps, stringifyJson, toEm, toHash, toPx, toRem, toResponsiveObject, traverse, uncapitalize, unionType, uniq, walkObject, withoutImportant, withoutSpace }; |
-284
| //#region src/arbitrary-value.d.ts | ||
| declare const getArbitraryValue: (_value: string) => string; | ||
| //#endregion | ||
| //#region src/assert.d.ts | ||
| declare const isString: (v: any) => v is string; | ||
| declare const isBoolean: (v: any) => v is boolean; | ||
| type AnyFunction = (...args: any[]) => any; | ||
| declare const isFunction: (v: any) => v is AnyFunction; | ||
| declare function isObject(value: any): value is Record<string, any>; | ||
| declare const isSymbol: (v: any) => v is symbol; | ||
| declare const isObjectOrArray: (obj: unknown) => obj is object; | ||
| //#endregion | ||
| //#region src/assign.d.ts | ||
| declare function assign(target: any, ...sources: any[]): any; | ||
| //#endregion | ||
| //#region src/astish.d.ts | ||
| declare const astish: (val: string, tree?: any[]) => Record<string, any>; | ||
| //#endregion | ||
| //#region src/cache-map.d.ts | ||
| declare class CacheMap<K, V> implements Map<K, V> { | ||
| private cache; | ||
| private keysInUse; | ||
| private maxCacheSize; | ||
| constructor(maxCacheSize?: number); | ||
| get(key: K): V | undefined; | ||
| set(key: K, value: V): this; | ||
| delete(key: K): boolean; | ||
| private updateKeyUsage; | ||
| private evictLeastRecentlyUsed; | ||
| clear(): void; | ||
| has(key: K): boolean; | ||
| get size(): number; | ||
| forEach(callback: (value: V, key: K, map: Map<K, V>) => void, thisArg?: any): void; | ||
| keys(): MapIterator<K>; | ||
| values(): MapIterator<V>; | ||
| entries(): MapIterator<[K, V]>; | ||
| getOrInsert(key: K, defaultValue: V): V; | ||
| getOrInsertComputed(key: K, callback: (key: K) => V): V; | ||
| [Symbol.iterator](): MapIterator<[K, V]>; | ||
| [Symbol.toStringTag]: string; | ||
| toJSON: () => Map<K, V>; | ||
| } | ||
| //#endregion | ||
| //#region src/calc.d.ts | ||
| type Operand = string | number | { | ||
| ref: string; | ||
| }; | ||
| declare const calc: { | ||
| negate(x: Operand): string; | ||
| }; | ||
| //#endregion | ||
| //#region src/camelcase-property.d.ts | ||
| declare const camelCaseProperty: (property: string) => string; | ||
| //#endregion | ||
| //#region src/capitalize.d.ts | ||
| declare const capitalize: (s: string) => string; | ||
| declare const dashCase: (s: string) => string; | ||
| declare const uncapitalize: (s: string) => string; | ||
| //#endregion | ||
| //#region src/classname.d.ts | ||
| interface CreateCssContext { | ||
| hash?: boolean; | ||
| grouped?: boolean; | ||
| /** | ||
| * Partial properties from the Utility class | ||
| */ | ||
| utility: { | ||
| prefix: string; | ||
| hasShorthand: boolean; | ||
| resolveShorthand: (prop: string) => string; | ||
| transform: (prop: string, value: any) => { | ||
| className: string; | ||
| }; | ||
| toHash: (path: string[], toHash: (str: string) => string) => string; | ||
| }; | ||
| /** | ||
| * Partial properties from the Condition class | ||
| */ | ||
| conditions?: { | ||
| breakpoints: { | ||
| keys: string[]; | ||
| }; | ||
| shift: (paths: string[]) => string[]; | ||
| finalize: (paths: string[]) => string[]; | ||
| }; | ||
| } | ||
| declare function createCss(context: CreateCssContext): ({ | ||
| base, | ||
| ...styles | ||
| }?: Record<string, any>) => string; | ||
| interface StyleObject { | ||
| [key: string]: any; | ||
| } | ||
| declare function createMergeCss(context: CreateCssContext): { | ||
| mergeCss: (...styles: StyleObject[]) => StyleObject; | ||
| assignCss: (...styles: StyleObject[]) => any; | ||
| }; | ||
| //#endregion | ||
| //#region src/compact.d.ts | ||
| declare function compact<T extends Record<string, any>>(value: T): T; | ||
| //#endregion | ||
| //#region src/condition.d.ts | ||
| declare const isBaseCondition: (v: string) => v is "base"; | ||
| declare function filterBaseConditions(c: string[]): string[]; | ||
| //#endregion | ||
| //#region src/css-var.d.ts | ||
| interface CssVar { | ||
| var: `--${string}`; | ||
| ref: string; | ||
| } | ||
| interface CssVarOptions { | ||
| fallback?: string; | ||
| prefix?: string; | ||
| hash?: boolean; | ||
| } | ||
| declare function cssVar(name: string, options?: CssVarOptions): CssVar; | ||
| //#endregion | ||
| //#region src/deep-set.d.ts | ||
| type Dict$2 = Record<string, any>; | ||
| declare const deepSet: <T extends Dict$2>(target: T, path: string[], value: Dict$2 | string) => T; | ||
| //#endregion | ||
| //#region src/entries.d.ts | ||
| declare function fromEntries<A extends symbol | string | number, B>(entries: [A, B][]): { [key in A]: B }; | ||
| declare function entries<A extends symbol | string | number, B>(obj: { [key in A]: B }): [A, B][]; | ||
| declare function mapEntries<A, B, K extends string | number | symbol>(obj: { [key in K]: A }, f: (key: K, val: A) => [K, B]): { [key in K]: B }; | ||
| //#endregion | ||
| //#region src/error.d.ts | ||
| type BambooErrorCode = 'CONFIG_NOT_FOUND' | 'CONFIG_ERROR' | 'NOT_FOUND' | 'CONDITION' | 'MISSING_STUDIO' | 'INVALID_LAYER' | 'UNKNOWN_RECIPE' | 'INVALID_RECIPE' | 'UNKNOWN_TYPE' | 'UNKNOWN_ARTIFACT' | 'UNKNOWN_LITERAL_TYPE' | 'UNKNOWN_RESULT_TYPE' | 'MISSING_PARAMS' | 'NO_CONTEXT' | 'INVALID_TOKEN'; | ||
| declare class BambooError extends Error { | ||
| readonly code: string; | ||
| readonly hint?: string; | ||
| constructor(code: BambooErrorCode, message: string, opts?: { | ||
| hint?: string; | ||
| cause?: unknown; | ||
| }); | ||
| } | ||
| //#endregion | ||
| //#region src/esc.d.ts | ||
| declare const esc: (sel: string) => string; | ||
| //#endregion | ||
| //#region src/walk-object.d.ts | ||
| type Predicate<R = any> = (value: any, path: string[]) => R; | ||
| type MappedObject<T, K> = { [Prop in keyof T]: T[Prop] extends Array<any> ? MappedObject<T[Prop][number], K>[] : T[Prop] extends Record<string, unknown> ? MappedObject<T[Prop], K> : K }; | ||
| type WalkObjectStopFn = (value: any, path: string[]) => boolean; | ||
| interface WalkObjectOptions { | ||
| stop?: WalkObjectStopFn; | ||
| getKey?(prop: string, value: any): string; | ||
| } | ||
| declare function walkObject<T, K>(target: T, predicate: Predicate<K>, options?: WalkObjectOptions): MappedObject<T, ReturnType<Predicate<K>>>; | ||
| declare function mapObject(obj: any, fn: (value: any) => any): any; | ||
| //#endregion | ||
| //#region src/flatten.d.ts | ||
| declare function flatten(values: Record<string, Record<string, any>>, stop?: WalkObjectStopFn): Record<string, any>; | ||
| //#endregion | ||
| //#region src/get-or-create-set.d.ts | ||
| declare function getOrCreateSet<TKey, TValue>(map: Map<TKey, Set<TValue>>, key: TKey): Set<TValue>; | ||
| //#endregion | ||
| //#region src/hash.d.ts | ||
| declare function toHash(value: string): string; | ||
| //#endregion | ||
| //#region src/hypenate-property.d.ts | ||
| declare const hypenateProperty: (property: string) => string; | ||
| //#endregion | ||
| //#region src/important.d.ts | ||
| declare function isImportant<T extends string | number | boolean>(value: T): boolean; | ||
| declare function withoutImportant<T extends string | number | boolean>(value: T): string | T; | ||
| declare function withoutSpace<T extends string | number | boolean>(str: T): string | T; | ||
| type Dict$1 = Record<string, unknown>; | ||
| declare function markImportant(obj: Dict$1): {}; | ||
| //#endregion | ||
| //#region src/is-css-function.d.ts | ||
| declare const isCssFunction: (v: unknown) => boolean; | ||
| //#endregion | ||
| //#region src/is-css-unit.d.ts | ||
| declare const isCssUnit: (v: unknown) => boolean; | ||
| //#endregion | ||
| //#region src/is-css-var.d.ts | ||
| declare const isCssVar: (v: unknown) => boolean; | ||
| //#endregion | ||
| //#region src/memo.d.ts | ||
| declare const memo: <T extends (...args: any[]) => any>(fn: T) => T; | ||
| //#endregion | ||
| //#region src/merge-anything.d.ts | ||
| /** | ||
| * Credits: https://github.com/mesqueeb/merge-anything | ||
| */ | ||
| declare function mergeAndConcat<T, const Tn extends unknown[]>(object: T, ...otherObjects: Tn): any; | ||
| //#endregion | ||
| //#region src/merge-props.d.ts | ||
| declare function mergeProps<T extends Record<string, unknown>>(...sources: T[]): T; | ||
| //#endregion | ||
| //#region src/merge-with.d.ts | ||
| declare function mergeWith(target: any, ...sources: any[]): any; | ||
| //#endregion | ||
| //#region src/normalize-style-object.d.ts | ||
| type NormalizeContext = Pick<CreateCssContext, 'utility' | 'conditions'>; | ||
| declare function toResponsiveObject(values: string[], breakpoints: string[]): Record<string, string>; | ||
| declare function normalizeStyleObject(styles: Record<string, any>, context: NormalizeContext, shorthand?: boolean): MappedObject<Record<string, any>, any>; | ||
| //#endregion | ||
| //#region src/omit.d.ts | ||
| declare const omit: <T, K extends keyof T | (string & {})>(obj: T, paths: K[]) => Omit<T, K>; | ||
| //#endregion | ||
| //#region src/bamboo-config-name.d.ts | ||
| declare const BAMBOO_CONFIG_NAME: "__bamboo.config__"; | ||
| //#endregion | ||
| //#region src/pattern-fns.d.ts | ||
| declare const patternFns: { | ||
| map: typeof mapObject; | ||
| isCssFunction: (v: unknown) => boolean; | ||
| isCssVar: (v: unknown) => boolean; | ||
| isCssUnit: (v: unknown) => boolean; | ||
| }; | ||
| declare const getPatternStyles: (pattern: any, styles: Record<string, any>) => any; | ||
| //#endregion | ||
| //#region src/pick.d.ts | ||
| declare const pick: <T, K extends keyof T | (string & {})>(obj: T, paths: K[]) => Partial<T>; | ||
| //#endregion | ||
| //#region src/property-priority.d.ts | ||
| declare function getPropertyPriority(key: string): number; | ||
| //#endregion | ||
| //#region src/regex.d.ts | ||
| declare const createRegex: (item: Array<string | RegExp>) => RegExp; | ||
| //#endregion | ||
| //#region src/serialize.d.ts | ||
| declare const stringifyJson: (config: Record<string, any>) => string; | ||
| declare const parseJson: (config: string) => any; | ||
| //#endregion | ||
| //#region src/slot.d.ts | ||
| declare const getSlotRecipes: (recipe?: Record<string, any>) => Record<string, any>; | ||
| declare const getSlotCompoundVariant: <T extends { | ||
| css: any; | ||
| }>(compoundVariants: T[], slotName: string) => (T & { | ||
| css: any; | ||
| })[]; | ||
| //#endregion | ||
| //#region src/split.d.ts | ||
| declare function splitBy(value: string, separator?: string): any[]; | ||
| declare function splitDotPath(path: string): string[]; | ||
| declare function getNegativePath(path: string[]): string[]; | ||
| declare function getDotPath(obj: any, path: string, fallback?: any): any; | ||
| //#endregion | ||
| //#region src/split-props.d.ts | ||
| type Dict = Record<string, unknown>; | ||
| type PredicateFn = (key: string) => boolean; | ||
| type Key = PredicateFn | string[]; | ||
| declare function splitProps(props: Dict, ...keys: Key[]): Dict[]; | ||
| //#endregion | ||
| //#region src/to-json.d.ts | ||
| type MapToRecord<K extends Map<string, any>> = { [P in keyof K]: K[P] extends Map<string, infer V> ? Record<string, V> : never }; | ||
| declare function mapToJson<T extends Map<string, any>>(map: T): MapToRecord<T>; | ||
| //#endregion | ||
| //#region src/traverse.d.ts | ||
| type CallbackFn = (args: CallbackItem) => void; | ||
| interface CallbackItem { | ||
| value: any; | ||
| path: string; | ||
| paths: string[]; | ||
| depth: number; | ||
| parent: any[] | Record<string, unknown>; | ||
| key: string; | ||
| } | ||
| interface TraverseOptions { | ||
| separator?: string; | ||
| maxDepth?: number; | ||
| stop?: (args: CallbackItem) => boolean; | ||
| } | ||
| declare function traverse(obj: any, callback: CallbackFn, options?: TraverseOptions): void; | ||
| //#endregion | ||
| //#region src/typegen.d.ts | ||
| declare function unionType(values: IterableIterator<string> | string[] | readonly string[] | Set<string>, opts?: { | ||
| fallback?: string; | ||
| stringify?: (value: string) => string; | ||
| }): string; | ||
| //#endregion | ||
| //#region src/uniq.d.ts | ||
| declare const uniq: <T>(...items: T[][]) => T[]; | ||
| //#endregion | ||
| //#region src/unit-conversion.d.ts | ||
| declare function getUnit(value?: string): string | undefined; | ||
| declare function toPx(value?: string | number): string | undefined; | ||
| declare function toEm(value?: string, fontSize?: number): string | undefined; | ||
| declare function toRem(value?: string): string | undefined; | ||
| //#endregion | ||
| export { BAMBOO_CONFIG_NAME, BambooError, BambooErrorCode, CacheMap, CreateCssContext, CssVar, CssVarOptions, MapToRecord, MappedObject, WalkObjectOptions, WalkObjectStopFn, assign, astish, calc, camelCaseProperty, capitalize, compact, createCss, createMergeCss, createRegex, cssVar, dashCase, deepSet, entries, esc, filterBaseConditions, flatten, fromEntries, getArbitraryValue, getDotPath, getNegativePath, getOrCreateSet, getPatternStyles, getPropertyPriority, getSlotCompoundVariant, getSlotRecipes, getUnit, hypenateProperty, isBaseCondition, isBoolean, isCssFunction, isCssUnit, isCssVar, isFunction, isImportant, isObject, isObjectOrArray, isString, isSymbol, mapEntries, mapObject, mapToJson, markImportant, memo, mergeAndConcat, mergeProps, mergeWith, normalizeStyleObject, omit, parseJson, patternFns, pick, splitBy, splitDotPath, splitProps, stringifyJson, toEm, toHash, toPx, toRem, toResponsiveObject, traverse, uncapitalize, unionType, uniq, walkObject, withoutImportant, withoutSpace }; |
| //#region src/normalize-html.d.ts | ||
| declare function normalizeHTMLProps(props: Record<string, any>): { | ||
| [k: string]: any; | ||
| }; | ||
| declare namespace normalizeHTMLProps { | ||
| var keys: string[]; | ||
| } | ||
| //#endregion | ||
| export { normalizeHTMLProps }; |
| //#region src/normalize-html.d.ts | ||
| declare function normalizeHTMLProps(props: Record<string, any>): { | ||
| [k: string]: any; | ||
| }; | ||
| declare namespace normalizeHTMLProps { | ||
| var keys: string[]; | ||
| } | ||
| //#endregion | ||
| export { normalizeHTMLProps }; |
| //#region src/assert.d.ts | ||
| declare function isObject(value: any): value is Record<string, any>; | ||
| //#endregion | ||
| //#region src/classname.d.ts | ||
| interface CreateCssContext { | ||
| hash?: boolean; | ||
| grouped?: boolean; | ||
| /** | ||
| * Partial properties from the Utility class | ||
| */ | ||
| utility: { | ||
| prefix: string; | ||
| hasShorthand: boolean; | ||
| resolveShorthand: (prop: string) => string; | ||
| transform: (prop: string, value: any) => { | ||
| className: string; | ||
| }; | ||
| toHash: (path: string[], toHash: (str: string) => string) => string; | ||
| }; | ||
| /** | ||
| * Partial properties from the Condition class | ||
| */ | ||
| conditions?: { | ||
| breakpoints: { | ||
| keys: string[]; | ||
| }; | ||
| shift: (paths: string[]) => string[]; | ||
| finalize: (paths: string[]) => string[]; | ||
| }; | ||
| } | ||
| declare function createCss(context: CreateCssContext): ({ | ||
| base, | ||
| ...styles | ||
| }?: Record<string, any>) => string; | ||
| interface StyleObject { | ||
| [key: string]: any; | ||
| } | ||
| declare function createMergeCss(context: CreateCssContext): { | ||
| mergeCss: (...styles: StyleObject[]) => StyleObject; | ||
| assignCss: (...styles: StyleObject[]) => any; | ||
| }; | ||
| //#endregion | ||
| //#region src/compact.d.ts | ||
| declare function compact<T extends Record<string, any>>(value: T): T; | ||
| //#endregion | ||
| //#region src/condition.d.ts | ||
| declare const isBaseCondition: (v: string) => v is "base"; | ||
| declare function filterBaseConditions(c: string[]): string[]; | ||
| //#endregion | ||
| //#region src/important.d.ts | ||
| declare function withoutSpace<T extends string | number | boolean>(str: T): string | T; | ||
| //#endregion | ||
| //#region src/hash.d.ts | ||
| declare function toHash(value: string): string; | ||
| //#endregion | ||
| //#region src/hypenate-property.d.ts | ||
| declare const hypenateProperty: (property: string) => string; | ||
| //#endregion | ||
| //#region src/memo.d.ts | ||
| declare const memo: <T extends (...args: any[]) => any>(fn: T) => T; | ||
| //#endregion | ||
| //#region src/merge-props.d.ts | ||
| declare function mergeProps<T extends Record<string, unknown>>(...sources: T[]): T; | ||
| //#endregion | ||
| //#region src/walk-object.d.ts | ||
| type Predicate<R = any> = (value: any, path: string[]) => R; | ||
| type MappedObject<T, K> = { [Prop in keyof T]: T[Prop] extends Array<any> ? MappedObject<T[Prop][number], K>[] : T[Prop] extends Record<string, unknown> ? MappedObject<T[Prop], K> : K }; | ||
| type WalkObjectStopFn = (value: any, path: string[]) => boolean; | ||
| interface WalkObjectOptions { | ||
| stop?: WalkObjectStopFn; | ||
| getKey?(prop: string, value: any): string; | ||
| } | ||
| declare function walkObject<T, K>(target: T, predicate: Predicate<K>, options?: WalkObjectOptions): MappedObject<T, ReturnType<Predicate<K>>>; | ||
| declare function mapObject(obj: any, fn: (value: any) => any): any; | ||
| //#endregion | ||
| //#region src/pattern-fns.d.ts | ||
| declare const patternFns: { | ||
| map: typeof mapObject; | ||
| isCssFunction: (v: unknown) => boolean; | ||
| isCssVar: (v: unknown) => boolean; | ||
| isCssUnit: (v: unknown) => boolean; | ||
| }; | ||
| declare const getPatternStyles: (pattern: any, styles: Record<string, any>) => any; | ||
| //#endregion | ||
| //#region src/slot.d.ts | ||
| declare const getSlotRecipes: (recipe?: Record<string, any>) => Record<string, any>; | ||
| declare const getSlotCompoundVariant: <T extends { | ||
| css: any; | ||
| }>(compoundVariants: T[], slotName: string) => (T & { | ||
| css: any; | ||
| })[]; | ||
| //#endregion | ||
| //#region src/split-props.d.ts | ||
| type Dict = Record<string, unknown>; | ||
| type PredicateFn = (key: string) => boolean; | ||
| type Key = PredicateFn | string[]; | ||
| declare function splitProps(props: Dict, ...keys: Key[]): Dict[]; | ||
| //#endregion | ||
| //#region src/uniq.d.ts | ||
| declare const uniq: <T>(...items: T[][]) => T[]; | ||
| //#endregion | ||
| export { compact, createCss, createMergeCss, filterBaseConditions, getPatternStyles, getSlotCompoundVariant, getSlotRecipes, hypenateProperty, isBaseCondition, isObject, mapObject, memo, mergeProps, patternFns, splitProps, toHash, uniq, walkObject, withoutSpace }; |
| //#region src/assert.d.ts | ||
| declare function isObject(value: any): value is Record<string, any>; | ||
| //#endregion | ||
| //#region src/classname.d.ts | ||
| interface CreateCssContext { | ||
| hash?: boolean; | ||
| grouped?: boolean; | ||
| /** | ||
| * Partial properties from the Utility class | ||
| */ | ||
| utility: { | ||
| prefix: string; | ||
| hasShorthand: boolean; | ||
| resolveShorthand: (prop: string) => string; | ||
| transform: (prop: string, value: any) => { | ||
| className: string; | ||
| }; | ||
| toHash: (path: string[], toHash: (str: string) => string) => string; | ||
| }; | ||
| /** | ||
| * Partial properties from the Condition class | ||
| */ | ||
| conditions?: { | ||
| breakpoints: { | ||
| keys: string[]; | ||
| }; | ||
| shift: (paths: string[]) => string[]; | ||
| finalize: (paths: string[]) => string[]; | ||
| }; | ||
| } | ||
| declare function createCss(context: CreateCssContext): ({ | ||
| base, | ||
| ...styles | ||
| }?: Record<string, any>) => string; | ||
| interface StyleObject { | ||
| [key: string]: any; | ||
| } | ||
| declare function createMergeCss(context: CreateCssContext): { | ||
| mergeCss: (...styles: StyleObject[]) => StyleObject; | ||
| assignCss: (...styles: StyleObject[]) => any; | ||
| }; | ||
| //#endregion | ||
| //#region src/compact.d.ts | ||
| declare function compact<T extends Record<string, any>>(value: T): T; | ||
| //#endregion | ||
| //#region src/condition.d.ts | ||
| declare const isBaseCondition: (v: string) => v is "base"; | ||
| declare function filterBaseConditions(c: string[]): string[]; | ||
| //#endregion | ||
| //#region src/important.d.ts | ||
| declare function withoutSpace<T extends string | number | boolean>(str: T): string | T; | ||
| //#endregion | ||
| //#region src/hash.d.ts | ||
| declare function toHash(value: string): string; | ||
| //#endregion | ||
| //#region src/hypenate-property.d.ts | ||
| declare const hypenateProperty: (property: string) => string; | ||
| //#endregion | ||
| //#region src/memo.d.ts | ||
| declare const memo: <T extends (...args: any[]) => any>(fn: T) => T; | ||
| //#endregion | ||
| //#region src/merge-props.d.ts | ||
| declare function mergeProps<T extends Record<string, unknown>>(...sources: T[]): T; | ||
| //#endregion | ||
| //#region src/walk-object.d.ts | ||
| type Predicate<R = any> = (value: any, path: string[]) => R; | ||
| type MappedObject<T, K> = { [Prop in keyof T]: T[Prop] extends Array<any> ? MappedObject<T[Prop][number], K>[] : T[Prop] extends Record<string, unknown> ? MappedObject<T[Prop], K> : K }; | ||
| type WalkObjectStopFn = (value: any, path: string[]) => boolean; | ||
| interface WalkObjectOptions { | ||
| stop?: WalkObjectStopFn; | ||
| getKey?(prop: string, value: any): string; | ||
| } | ||
| declare function walkObject<T, K>(target: T, predicate: Predicate<K>, options?: WalkObjectOptions): MappedObject<T, ReturnType<Predicate<K>>>; | ||
| declare function mapObject(obj: any, fn: (value: any) => any): any; | ||
| //#endregion | ||
| //#region src/pattern-fns.d.ts | ||
| declare const patternFns: { | ||
| map: typeof mapObject; | ||
| isCssFunction: (v: unknown) => boolean; | ||
| isCssVar: (v: unknown) => boolean; | ||
| isCssUnit: (v: unknown) => boolean; | ||
| }; | ||
| declare const getPatternStyles: (pattern: any, styles: Record<string, any>) => any; | ||
| //#endregion | ||
| //#region src/slot.d.ts | ||
| declare const getSlotRecipes: (recipe?: Record<string, any>) => Record<string, any>; | ||
| declare const getSlotCompoundVariant: <T extends { | ||
| css: any; | ||
| }>(compoundVariants: T[], slotName: string) => (T & { | ||
| css: any; | ||
| })[]; | ||
| //#endregion | ||
| //#region src/split-props.d.ts | ||
| type Dict = Record<string, unknown>; | ||
| type PredicateFn = (key: string) => boolean; | ||
| type Key = PredicateFn | string[]; | ||
| declare function splitProps(props: Dict, ...keys: Key[]): Dict[]; | ||
| //#endregion | ||
| //#region src/uniq.d.ts | ||
| declare const uniq: <T>(...items: T[][]) => T[]; | ||
| //#endregion | ||
| export { compact, createCss, createMergeCss, filterBaseConditions, getPatternStyles, getSlotCompoundVariant, getSlotRecipes, hypenateProperty, isBaseCondition, isObject, mapObject, memo, mergeProps, patternFns, splitProps, toHash, uniq, walkObject, withoutSpace }; |
116666
-21.24%10
-44.44%