Skip to content

Commit

Permalink
fix typing
Browse files Browse the repository at this point in the history
  • Loading branch information
indooorsman committed Feb 22, 2022
1 parent 85a3723 commit d12632a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
20 changes: 13 additions & 7 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
import type { Plugin } from 'esbuild';

declare type GenerateScopedNameFunction = (
name: string,
filename: string,
css: string
) => string;
declare type GenerateScopedNameFunction = (name: string, filename: string, css: string) => string;

declare type LocalsConventionFunction = (
originalClassName: string,
generatedClassName: string,
inputFile: string
) => string;

declare class Loader {
constructor(root: string, plugins: Plugin[]);

fetch(file: string, relativeTo: string, depTrace: string): Promise<{ [key: string]: string }>;

finalSource?: string | undefined;
}

declare interface CssModulesOptions {
getJSON?(cssFilename: string, json: { [name: string]: string }, outputFilename?: string): void;

Expand Down Expand Up @@ -44,6 +48,8 @@ declare interface PluginOptions {
v2?: boolean;
}

export default function CssModulesPlugin(options?: PluginOptions): Plugin;
declare function CssModulesPlugin(options?: PluginOptions): Plugin;

declare namespace CssModulesPlugin {}

export = CssModulesPlugin;
export = CssModulesPlugin;
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "esbuild-css-modules-plugin",
"version": "2.1.5",
"version": "2.1.6",
"description": "A esbuild plugin to bundle css modules into js(x)/ts(x).",
"main": "index.js",
"keywords": [
Expand Down

0 comments on commit d12632a

Please sign in to comment.