mirror of
https://github.com/Microsoft/vscode
synced 2024-09-19 02:26:04 +00:00
Update GDPR typings to allow for top level metadata. (#146943)
* Update gdpr typings * Try out new typing
This commit is contained in:
parent
e2b873e1af
commit
f1e2e9990b
|
@ -13,11 +13,16 @@ export interface IPropertyData {
|
|||
}
|
||||
|
||||
export interface IGDPRProperty {
|
||||
readonly [name: string]: IPropertyData | undefined | IGDPRProperty;
|
||||
owner?: string;
|
||||
comment?: string;
|
||||
expiration?: string;
|
||||
readonly [name: string]: IPropertyData | undefined | IGDPRProperty | string;
|
||||
}
|
||||
|
||||
export type IGDPRPropertyWithoutMetadata<T> = Omit<T, 'owner' | 'comment' | 'expiration'>;
|
||||
|
||||
export type ClassifiedEvent<T extends IGDPRProperty> = {
|
||||
[k in keyof T]: any
|
||||
[k in keyof IGDPRPropertyWithoutMetadata<T>]: any
|
||||
};
|
||||
|
||||
export type StrictPropertyChecker<TEvent, TClassifiedEvent, TError> = keyof TEvent extends keyof TClassifiedEvent ? keyof TClassifiedEvent extends keyof TEvent ? TEvent : TError : TError;
|
||||
|
@ -26,4 +31,4 @@ export type StrictPropertyCheckError = 'Type of classified event does not match
|
|||
|
||||
export type StrictPropertyCheck<T extends IGDPRProperty, E> = StrictPropertyChecker<E, ClassifiedEvent<T>, StrictPropertyCheckError>;
|
||||
|
||||
export type GDPRClassification<T> = { [_ in keyof T]: IPropertyData | IGDPRProperty | undefined };
|
||||
export type GDPRClassification<T> = { [_ in keyof T]: IPropertyData | IGDPRProperty | undefined | string };
|
||||
|
|
|
@ -55,7 +55,7 @@ export class MainThreadTelemetry extends Disposable implements MainThreadTelemet
|
|||
this._telemetryService.publicLog(eventName, data);
|
||||
}
|
||||
|
||||
$publicLog2<E extends ClassifiedEvent<T> = never, T extends GDPRClassification<T> = never>(eventName: string, data: StrictPropertyCheck<T, E>): void {
|
||||
$publicLog2<E extends ClassifiedEvent<T> = never, T extends GDPRClassification<T> = never>(eventName: string, data?: StrictPropertyCheck<T, E>): void {
|
||||
this.$publicLog(eventName, data as any);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -746,7 +746,9 @@ export class EditorResolverService extends Disposable implements IEditorResolver
|
|||
|
||||
private sendEditorResolutionTelemetry(chosenInput: EditorInput): void {
|
||||
type editorResolutionClassification = {
|
||||
viewType: { classification: 'PublicNonPersonalData'; purpose: 'FeatureInsight'; owner: 'lramos15'; comment: 'The id of the editor opened. Used to gain an undertsanding of what editors are most popular' };
|
||||
viewType: { classification: 'PublicNonPersonalData'; purpose: 'FeatureInsight'; comment: 'The id of the editor opened. Used to gain an undertsanding of what editors are most popular' };
|
||||
owner: 'lramos15';
|
||||
comment: 'Event sent when an editor type is determined.';
|
||||
};
|
||||
type editorResolutionEvent = {
|
||||
viewType: string;
|
||||
|
|
Loading…
Reference in a new issue