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 | }
|
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 | export declare interface DataGroup {
|
43 | name: string;
|
44 | urls: Glob[];
|
45 | version?: number;
|
46 | cacheConfig: {
|
47 | maxSize: number;
|
48 | maxAge: Duration;
|
49 | timeout?: Duration;
|
50 | strategy?: 'freshness' | 'performance';
|
51 | };
|
52 | cacheQueryOptions?: Pick<CacheQueryOptions, 'ignoreSearch'>;
|
53 | }
|
54 |
|
55 |
|
56 |
|
57 |
|
58 | export declare type Duration = string;
|
59 |
|
60 |
|
61 |
|
62 |
|
63 |
|
64 |
|
65 |
|
66 |
|
67 | export declare interface Filesystem {
|
68 | list(dir: string): Promise<string[]>;
|
69 | read(file: string): Promise<string>;
|
70 | hash(file: string): Promise<string>;
|
71 | write(file: string, contents: string): Promise<void>;
|
72 | }
|
73 |
|
74 |
|
75 |
|
76 |
|
77 |
|
78 |
|
79 | export declare class Generator {
|
80 | readonly fs: Filesystem;
|
81 | private baseHref;
|
82 | constructor(fs: Filesystem, baseHref: string);
|
83 | process(config: Config): Promise<Object>;
|
84 | private processAssetGroups;
|
85 | private processDataGroups;
|
86 | }
|
87 |
|
88 |
|
89 | /**
|
90 | * @publicApi
|
91 | */
|
92 | export declare type Glob = string;
|
93 |
|
94 | export { }
|