mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 19:07:08 +00:00
* Add type definitions for cxs-css/cxs * Address linter/CI issues * Fix importing and reintroduce ts-expect-error * Fix tsconfig * Fix import path in tests * Omit ts-expect-error * Try to fix compile error * Use ts-expect-error instead of $ExpectError * Remove directive in component * Remove error-causing callsites * Prefer interface over props * Turn off export to fix lint error
28 lines
861 B
TypeScript
28 lines
861 B
TypeScript
// Type definitions for cxs 6.2
|
|
// Project: https://github.com/cxs-css/cxs
|
|
// Definitions by: Daniel Eden <https://github.com/daneden>
|
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
// Minimum TypeScript Version 3.9
|
|
import * as CSS from 'csstype';
|
|
|
|
declare namespace cxs {
|
|
type CSSProperties = CSS.Properties<string | number>;
|
|
type CSSPseudos = { [K in CSS.Pseudos]?: CSSObject };
|
|
|
|
interface CSSObject extends CSSProperties, CSSPseudos {
|
|
[key: string]: CSSObject | string | number | undefined;
|
|
}
|
|
}
|
|
|
|
declare const cxs: {
|
|
(styles: cxs.CSSObject): string;
|
|
/** Returns cached CSS as a string for server-side rendering */
|
|
css: () => string;
|
|
/** Resets the CSS cache for future renders */
|
|
reset: () => void;
|
|
/** Sets a custom className prefix */
|
|
prefix: (val: string) => void;
|
|
};
|
|
|
|
export = cxs;
|