Skip to content

Commit

Permalink
Updated MandatoryProjectDataType JSDoc to match current type enforcem…
Browse files Browse the repository at this point in the history
…ent (#690)
  • Loading branch information
tjcouch-sil authored Dec 21, 2023
2 parents 35bd959 + 0560c0c commit c15dc2e
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
16 changes: 15 additions & 1 deletion lib/papi-dts/papi.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2184,7 +2184,21 @@ declare module 'shared/models/project-data-provider.model' {
*/
dataQualifier: string;
};
/** All Project Data Provider data types must extend from this */
/**
* All Project Data Provider data types must have an `ExtensionData` type. We strongly recommend all
* Project Data Provider data types extend from this type in order to standardize the
* `ExtensionData` types.
*
* Benefits of following this standard:
*
* - All PSIs that support this `projectType` can use a standardized `ExtensionData` interface
* - If an extension uses the `ExtensionData` endpoint for any project, it will likely use this
* standardized interface, so using this interface on your Project Data Provider data types
* enables your PDP to support generic extension data
* - In the future, we may enforce that callers to `ExtensionData` endpoints include `extensionName`,
* so following this interface ensures your PDP will not break if such a requirement is
* implemented.
*/
export type MandatoryProjectDataType = {
ExtensionData: DataProviderDataType<ExtensionDataScope, string | undefined, string>;
};
Expand Down
16 changes: 15 additions & 1 deletion src/shared/models/project-data-provider.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,21 @@ export type ExtensionDataScope = {
dataQualifier: string;
};

/** All Project Data Provider data types must extend from this */
/**
* All Project Data Provider data types must have an `ExtensionData` type. We strongly recommend all
* Project Data Provider data types extend from this type in order to standardize the
* `ExtensionData` types.
*
* Benefits of following this standard:
*
* - All PSIs that support this `projectType` can use a standardized `ExtensionData` interface
* - If an extension uses the `ExtensionData` endpoint for any project, it will likely use this
* standardized interface, so using this interface on your Project Data Provider data types
* enables your PDP to support generic extension data
* - In the future, we may enforce that callers to `ExtensionData` endpoints include `extensionName`,
* so following this interface ensures your PDP will not break if such a requirement is
* implemented.
*/
export type MandatoryProjectDataType = {
ExtensionData: DataProviderDataType<ExtensionDataScope, string | undefined, string>;
};

0 comments on commit c15dc2e

Please sign in to comment.