mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
refactor: Relocate a type definition.
This commit is contained in:
parent
1f9847ed98
commit
fd9a172da9
2 changed files with 3 additions and 4 deletions
|
@ -51,13 +51,13 @@ export type SubtypeRecord = Readonly<{
|
|||
}>;
|
||||
|
||||
// Subtype Names
|
||||
export type Subtype = string;
|
||||
export type Subtype = Required<ExcalidrawElement>["subtype"];
|
||||
export const getSubtypeNames = (): readonly Subtype[] => {
|
||||
return subtypeNames;
|
||||
};
|
||||
export const isValidSubtype = (s: any, t: any): s is Subtype =>
|
||||
parentTypeMap.find(
|
||||
(val) => val.subtype === (s as string) && val.parentType === (t as string),
|
||||
(val) => (val.subtype as any) === s && (val.parentType as any) === t,
|
||||
) !== undefined;
|
||||
const isSubtypeName = (s: any): s is Subtype => subtypeNames.includes(s);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue