-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Is your feature request related to a problem? Please describe.
- We currently can only validate JSON entries against a given schema, but we cannot perform any integrity checks.
- We currently cannot perform any validity/type checking on a code contribution
cwhen registering it usingregisterCodeContribution<T>(c). We must rely on the user thatcis valid and of typeT.
Describe the solution you'd like
Allow for optional validators isEntryValid and isContributionValid to ManifestContributionInfo and CodeContributionInfo when defining a new ContributionPoint:
export interface ManifestContributionInfo<TM = unknown, TS = TM> {
schema: JsonTypedSchema<TM> | JsonSchema;
processEntry?: (entry: TM) => TS;
isEntryValid(entry: unknown)?: entry is TM; /* NEW */
}
export interface CodeContributionInfo<TS = unknown> {
idKey?: KeyOfObjOrArrayItem<TS>;
activationEvent?: string;
isContributionValid<TC = unknown>(contrib: unknown)?: contrib is TC; /* NEW */
}Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request