Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
335 B
3
Indexable
Never
type CrudMethods = 'create' | 'update' | 'remove';

export interface Crudable<M extends Identifiable, T extends CrudMethods[]> {
    getAll(): Observable<Array<M>>;
    [K in T[number]]: (
        item: T extends 'create' ? M : T extends 'update' ? M : string
    ) => Observable<T extends 'create' | 'update' ? M : string>;
}
Leave a Comment