-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
change AttachmentTable type : add Entity type
- Loading branch information
1 parent
5712d52
commit bc380aa
Showing
3 changed files
with
74 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,23 @@ | ||
export type AttachableEntity<ENTITY_TYPE> = { | ||
export type AttachableEntity< | ||
ENTITY_TYPE, | ||
ENTITY extends Record<string, unknown> = Record<string, unknown>, | ||
> = { | ||
name: string; | ||
id: string; | ||
type: ENTITY_TYPE; | ||
disableDetach?: boolean; | ||
completeEntity?: ENTITY; | ||
}; | ||
|
||
export enum AttachmentAction { | ||
ADD, | ||
REMOVE, | ||
} | ||
|
||
export type AttachmentOperation<ENTITY_TYPE> = { | ||
export type AttachmentOperation< | ||
ENTITY_TYPE, | ||
ENTITY extends Record<string, unknown> = Record<string, unknown>, | ||
> = { | ||
action: AttachmentAction; | ||
entity: AttachableEntity<ENTITY_TYPE>; | ||
entity: AttachableEntity<ENTITY_TYPE, ENTITY>; | ||
}; |