I have a Vuex module factory that, has some default mutations and actions. I'd like to document these using better-docs which uses JSDoc syntax. However, I am stuck on documenting methods that are in mutations object that is a property of CustomModule class.
I tried using this way, however, it didn't work for me.
This is the example code
/**
*
* A generic class to create custom Vuex module
* @export
* @abstract
* @class CustomModule
* @category Generic Store
* @template Entity Entity used in state
* @property {Repository} repository Generic class for handling requests
* @property {object} mutations Contains all Vuex mutations
*/
export abstract class CustomModule<Entity extends EntityBasee> = {}> {
/**
* Mutations
* @memberof CustomModule
* @alias Mutations
*/
mutations = {
// I want to document these methods to be something like that CustomModule.mutations.assignItems
assignItems: (state: ModuleState<Entity>, value: Entity[]) => {
state.items = value;
},
selectItem: (state: ModuleState<Entity>, value: Entity) => {
state.selectedItem = value;
},
setIsLoading: (state: ModuleState<Entity>, value: boolean) => {
state.isLoading = value;
},
setError: (state: ModuleState<Entity>, value: string) => {
state.error = value;
}
};
}