chokibasic 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.d.ts +38 -0
  2. package/package.json +3 -5
package/index.d.ts ADDED
@@ -0,0 +1,38 @@
1
+ export type WatchEventType = "add" | "change" | "unlink";
2
+
3
+ export interface WatchEvent {
4
+ type: WatchEventType;
5
+ file: string; // chemin relatif (posix) comme dans ton code
6
+ }
7
+
8
+ export interface WatchRule {
9
+ name?: string;
10
+ patterns: string | string[];
11
+ ignored?: (string | RegExp | ((relPosix: string) => boolean))[];
12
+ debounceMs?: number;
13
+ callback: (events: WatchEvent[], ctx: { rule: WatchRule }) => void | Promise<void>;
14
+ }
15
+
16
+ export interface WatchOptions {
17
+ cwd?: string;
18
+ globalIgnored?: string[];
19
+
20
+ ignoreInitial?: boolean;
21
+ awaitWriteFinish?: { stabilityThreshold: number; pollInterval: number };
22
+
23
+ usePolling?: boolean;
24
+ interval?: number;
25
+ binaryInterval?: number;
26
+
27
+ debug?: boolean;
28
+ }
29
+
30
+ export function createWatchers(
31
+ rules: WatchRule[],
32
+ options?: WatchOptions
33
+ ): {
34
+ close: () => Promise<void>;
35
+ };
36
+
37
+ export function buildCSS(inputScss: string, outCssMin: string): Promise<void>;
38
+ export function buildJS(entry: string, outfile: string): Promise<void>;
package/package.json CHANGED
@@ -1,8 +1,10 @@
1
1
  {
2
2
  "name": "chokibasic",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Basic chokidar watcher + esbuild + sass + csso helpers",
5
5
  "main": "index.js",
6
+ "types": "index.d.ts",
7
+ "files": ["index.js", "index.d.ts", "src/"],
6
8
  "scripts": {
7
9
  "test": "echo \"Error: no test specified\" && exit 1"
8
10
  },
@@ -24,10 +26,6 @@
24
26
  "url": "https://github.com/ZmotriN/chokibasic/issues"
25
27
  },
26
28
  "homepage": "https://github.com/ZmotriN/chokibasic#readme",
27
- "files": [
28
- "index.js",
29
- "src/"
30
- ],
31
29
  "dependencies": {
32
30
  "chokidar": "^5.0.0",
33
31
  "csso": "^5.0.5",