chore: Improve typings around model methods (#6324)
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
/* eslint-disable @typescript-eslint/ban-types */
|
||||
import { Location, LocationDescriptor } from "history";
|
||||
import { TFunction } from "i18next";
|
||||
import { JSONValue } from "@shared/types";
|
||||
import RootStore from "~/stores/RootStore";
|
||||
import Document from "./models/Document";
|
||||
import FileOperation from "./models/FileOperation";
|
||||
@@ -198,3 +200,10 @@ export type WebsocketEvent =
|
||||
export type AwarenessChangeEvent = {
|
||||
states: { user?: { id: string }; cursor: any; scrollY: number | undefined }[];
|
||||
};
|
||||
|
||||
// TODO: Can we make this type driven by the @Field decorator
|
||||
export type Properties<C> = {
|
||||
[Property in keyof C as C[Property] extends JSONValue
|
||||
? Property
|
||||
: never]?: C[Property];
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user