Skip to content

Commit d12632a

Browse files
committed
fix typing
1 parent 85a3723 commit d12632a

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

index.d.ts

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
import type { Plugin } from 'esbuild';
22

3-
declare type GenerateScopedNameFunction = (
4-
name: string,
5-
filename: string,
6-
css: string
7-
) => string;
3+
declare type GenerateScopedNameFunction = (name: string, filename: string, css: string) => string;
84

95
declare type LocalsConventionFunction = (
106
originalClassName: string,
117
generatedClassName: string,
128
inputFile: string
139
) => string;
1410

11+
declare class Loader {
12+
constructor(root: string, plugins: Plugin[]);
13+
14+
fetch(file: string, relativeTo: string, depTrace: string): Promise<{ [key: string]: string }>;
15+
16+
finalSource?: string | undefined;
17+
}
18+
1519
declare interface CssModulesOptions {
1620
getJSON?(cssFilename: string, json: { [name: string]: string }, outputFilename?: string): void;
1721

@@ -44,6 +48,8 @@ declare interface PluginOptions {
4448
v2?: boolean;
4549
}
4650

47-
export default function CssModulesPlugin(options?: PluginOptions): Plugin;
51+
declare function CssModulesPlugin(options?: PluginOptions): Plugin;
52+
53+
declare namespace CssModulesPlugin {}
4854

49-
export = CssModulesPlugin;
55+
export = CssModulesPlugin;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "esbuild-css-modules-plugin",
3-
"version": "2.1.5",
3+
"version": "2.1.6",
44
"description": "A esbuild plugin to bundle css modules into js(x)/ts(x).",
55
"main": "index.js",
66
"keywords": [

0 commit comments

Comments
 (0)