javascript - Vscode nu detectează tipurile personalizate pentru jsdoc
Definiesc un tip personalizat după cum urmează:
/**
* function to create external storage storage vendor CR or resources.
* @export
* @callback CreatePayloadFunction
* @param {string} storageClass
* The name of the of the storage class required for creation of storage class resource.
*
* @param {string} systemName
* The name of the external storage system requried for the creation of the external custom resource.
*
* @param {Object} form
* The other fields of the create storage class form.
*
* @param {Object} model
* The model referring the `apiGroup`,`apiVersion` and `kind` of the external storage provider's CRD.
*
* @returns {{ model: ExtensionK8sModel; payload: K8sResourceKind }[]}}
*/
În același fișier folosesc asta după cum urmează:
export type ExternalStorage = {
/** Display name of the external storage vendor. */
displayName: string;
/** The model referring the `apiGroup`,`apiVersion` and `kind` of the external storage provider's CRD. */
model: ExtensionK8sModel;
/** @type {CreatePayloadFunction} */
createPayload: CreatePayload;
};
Când export obiectul ca:
export const SUPPORTED_EXTERNAL_STORAGE: ExternalStorage[] = [
{
displayName: 'Red Hat Ceph Storage',
model: {
group: OCSServiceModel.apiGroup,
version: OCSServiceModel.apiVersion,
kind: OCSServiceModel.kind,
},
Component: null,
createPayload: null,
},
Văd că vscode analizează obiectul doar ca {CreatePayloadFunction}
Cum să fac ca vscode să identifice tipurile?
