ci: move public-api goldens to goldens directory (#35768)

Moves the public api .d.ts files from tools/public_api_guard to
goldens/public-api.

Additionally, provides a README in the goldens directory and a script
assist in testing the current state of the repo against the goldens as
well as a command for accepting all changes to the goldens in a single
command.

PR Close #35768
This commit is contained in:
Joey Perrott
2020-02-26 09:09:35 -08:00
committed by Matias Niemelä
parent 19cfaf7f4c
commit 15f8afa4bf
62 changed files with 483 additions and 348 deletions

View File

@ -0,0 +1,46 @@
export declare interface AssetGroup {
installMode?: 'prefetch' | 'lazy';
name: string;
resources: {
files?: Glob[];
urls?: Glob[];
};
updateMode?: 'prefetch' | 'lazy';
}
export declare interface Config {
appData?: {};
assetGroups?: AssetGroup[];
dataGroups?: DataGroup[];
index: string;
navigationUrls?: string[];
}
export declare interface DataGroup {
cacheConfig: {
maxSize: number;
maxAge: Duration;
timeout?: Duration;
strategy?: 'freshness' | 'performance';
};
name: string;
urls: Glob[];
version?: number;
}
export declare type Duration = string;
export declare interface Filesystem {
hash(file: string): Promise<string>;
list(dir: string): Promise<string[]>;
read(file: string): Promise<string>;
write(file: string, contents: string): Promise<void>;
}
export declare class Generator {
readonly fs: Filesystem;
constructor(fs: Filesystem, baseHref: string);
process(config: Config): Promise<Object>;
}
export declare type Glob = string;

View File

@ -0,0 +1,59 @@
export declare class ServiceWorkerModule {
static register(script: string, opts?: SwRegistrationOptions): ModuleWithProviders<ServiceWorkerModule>;
}
export declare class SwPush {
get isEnabled(): boolean;
readonly messages: Observable<object>;
readonly notificationClicks: Observable<{
action: string;
notification: NotificationOptions & {
title: string;
};
}>;
readonly subscription: Observable<PushSubscription | null>;
constructor(sw: ɵangular_packages_service_worker_service_worker_a);
requestSubscription(options: {
serverPublicKey: string;
}): Promise<PushSubscription>;
unsubscribe(): Promise<void>;
}
export declare abstract class SwRegistrationOptions {
enabled?: boolean;
registrationStrategy?: string | (() => Observable<unknown>);
scope?: string;
}
export declare class SwUpdate {
readonly activated: Observable<UpdateActivatedEvent>;
readonly available: Observable<UpdateAvailableEvent>;
get isEnabled(): boolean;
constructor(sw: ɵangular_packages_service_worker_service_worker_a);
activateUpdate(): Promise<void>;
checkForUpdate(): Promise<void>;
}
export declare interface UpdateActivatedEvent {
current: {
hash: string;
appData?: Object;
};
previous?: {
hash: string;
appData?: Object;
};
type: 'UPDATE_ACTIVATED';
}
export declare interface UpdateAvailableEvent {
available: {
hash: string;
appData?: Object;
};
current: {
hash: string;
appData?: Object;
};
type: 'UPDATE_AVAILABLE';
}