mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-25 16:11:24 +08:00
Update index.d.ts
Add support for css pre-processors like `sass`, `less` etc.
This commit is contained in:
47
types/css-modules/index.d.ts
vendored
47
types/css-modules/index.d.ts
vendored
@@ -1,21 +1,38 @@
|
||||
// Type definitions for css-modules 1506
|
||||
// Type definitions for css-modules 1.0
|
||||
// Project: https://github.com/css-modules/css-modules
|
||||
// Definitions by: NeekSandhu <https://github.com/NeekSandhu>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
interface Stringifyable {
|
||||
/**
|
||||
* Stringifies the imported stylesheet for use with inline style tags
|
||||
*/
|
||||
toString(): string;
|
||||
}
|
||||
interface SelectorNode {
|
||||
/**
|
||||
* Returns the specific selector from imported stylesheet as string
|
||||
*/
|
||||
[key: string]: string;
|
||||
}
|
||||
|
||||
declare module '*.css' {
|
||||
type Stringifyable = {
|
||||
/**
|
||||
* Stringifies the imported stylesheet for use with inline style tags
|
||||
*/
|
||||
toString: () => string
|
||||
}
|
||||
type SelectorNode = {
|
||||
/**
|
||||
* Returns the specific selector from imported stylesheet as string
|
||||
*/
|
||||
[key: string]: string
|
||||
}
|
||||
const styles: SelectorNode & Stringifyable
|
||||
export default styles
|
||||
const styles: SelectorNode & Stringifyable;
|
||||
export default styles;
|
||||
}
|
||||
|
||||
declare module '*.scss' {
|
||||
const styles: SelectorNode & Stringifyable;
|
||||
export default styles;
|
||||
}
|
||||
|
||||
declare module '*.sass' {
|
||||
const styles: SelectorNode & Stringifyable;
|
||||
export default styles;
|
||||
}
|
||||
|
||||
declare module '*.less' {
|
||||
const styles: SelectorNode & Stringifyable;
|
||||
export default styles;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user