1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 | export declare interface AssetGroup {
|
14 | name: string;
|
15 | installMode?: 'prefetch' | 'lazy';
|
16 | updateMode?: 'prefetch' | 'lazy';
|
17 | resources: {
|
18 | files?: Glob[];
|
19 | urls?: Glob[];
|
20 | };
|
21 | cacheQueryOptions?: Pick<CacheQueryOptions, 'ignoreSearch'>;
|
22 | }
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 | export declare interface Config {
|
30 | appData?: {};
|
31 | index: string;
|
32 | assetGroups?: AssetGroup[];
|
33 | dataGroups?: DataGroup[];
|
34 | navigationUrls?: string[];
|
35 | navigationRequestStrategy?: 'freshness' | 'performance';
|
36 | }
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 |
|
43 | export declare interface DataGroup {
|
44 | name: string;
|
45 | urls: Glob[];
|
46 | version?: number;
|
47 | cacheConfig: {
|
48 | maxSize: number;
|
49 | maxAge: Duration;
|
50 | timeout?: Duration;
|
51 | strategy?: 'freshness' | 'performance';
|
52 | cacheOpaqueResponses?: boolean;
|
53 | };
|
54 | cacheQueryOptions?: Pick<CacheQueryOptions, 'ignoreSearch'>;
|
55 | }
|
56 |
|
57 |
|
58 |
|
59 |
|
60 | export declare type Duration = string;
|
61 |
|
62 |
|
63 |
|
64 |
|
65 |
|
66 |
|
67 |
|
68 |
|
69 | export declare interface Filesystem {
|
70 | list(dir: string): Promise<string[]>;
|
71 | read(file: string): Promise<string>;
|
72 | hash(file: string): Promise<string>;
|
73 | write(file: string, contents: string): Promise<void>;
|
74 | }
|
75 |
|
76 |
|
77 |
|
78 |
|
79 |
|
80 |
|
81 | declare class Generator_2 {
|
82 | readonly fs: Filesystem;
|
83 | private baseHref;
|
84 | constructor(fs: Filesystem, baseHref: string);
|
85 | process(config: Config): Promise<Object>;
|
86 | private processAssetGroups;
|
87 | private processDataGroups;
|
88 | }
|
89 | export { Generator_2 as Generator }
|
90 |
|
91 |
|
92 |
|
93 |
|
94 |
|
95 | export declare type Glob = string;
|
96 |
|
97 | export { }
|