1 | export const FSTree: FSTree.Static = require("fs-tree-diff");
|
2 | export const BroccoliPlugin: BroccoliPlugin.Static = require("broccoli-plugin");
|
3 | export const walkSync: WalkSync = require("walk-sync");
|
4 | export const md5Hex: MD5Hex = require("md5-hex");
|
5 | export const heimdall: Heimdall = require("heimdalljs");
|
6 |
|
7 | declare function require(id: string): any;
|
8 |
|
9 | export interface Token {
|
10 | __tokenBrand: any;
|
11 | }
|
12 |
|
13 | export interface Heimdall {
|
14 | start(name: string): Token;
|
15 | stop(token: Token): void;
|
16 | }
|
17 |
|
18 | export type MD5Hex = (str: string) => string;
|
19 |
|
20 | export namespace BroccoliPlugin {
|
21 | export interface PluginOptions {
|
22 | name?: string;
|
23 | annotation?: string;
|
24 | persistentOutput?: boolean;
|
25 | }
|
26 |
|
27 | export interface Plugin {
|
28 | inputPaths: string[];
|
29 | outputPath: string;
|
30 | cachePath: string;
|
31 | }
|
32 |
|
33 | export type Static = new (inputNodes: any[], options?: any) => Plugin;
|
34 | }
|
35 |
|
36 | export interface WalkSync {
|
37 | (path: string, options?: any): string[];
|
38 | entries(path: string, options?: any): WalkSync.Entry[];
|
39 | }
|
40 |
|
41 | export namespace WalkSync {
|
42 | export type Row = string | RegExp[];
|
43 |
|
44 | export interface Entry {
|
45 | relativePath: string;
|
46 | basePath: string;
|
47 | fullPath: string;
|
48 | checksum: string;
|
49 | mode: number;
|
50 | size: number;
|
51 | mtime: Date;
|
52 | isDirectory(): boolean;
|
53 | }
|
54 | }
|
55 |
|
56 | export interface FSTree {
|
57 | calculatePatch(
|
58 | next: FSTree,
|
59 | isUnchanged?: (a: WalkSync.Entry, b: WalkSync.Entry) => {}
|
60 | ): FSTree.PatchOp[];
|
61 | }
|
62 |
|
63 | export namespace FSTree {
|
64 | export type Op = "unlink" | "create" | "mkdir" | "rmdir" | "change";
|
65 |
|
66 | export type PatchOp = [Op, string, WalkSync.Entry];
|
67 |
|
68 | export interface Static {
|
69 | fromEntries(
|
70 | entries: WalkSync.Entry[],
|
71 | options?: {
|
72 | sortAndExpand?: boolean;
|
73 | }
|
74 | ): FSTree;
|
75 | }
|
76 | }
|