forked from microsoft/roosterjs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f753bec
commit 1bec03b
Showing
2 changed files
with
21 additions
and
0 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
20 changes: 20 additions & 0 deletions
20
packages/roosterjs-content-model-types/lib/parameter/MergeFormatValueCallback.ts
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import type { ContentModelFormatState } from './ContentModelFormatState'; | ||
|
||
/** | ||
* Callback function type to merge the values of a specific format key | ||
* @param format The current retrieved format state | ||
* @param newValue The new format value to merge | ||
*/ | ||
export type MergeFormatValueCallback = <K extends keyof ContentModelFormatState>( | ||
format: ContentModelFormatState, | ||
newValue: ContentModelFormatState[K] | undefined | ||
) => void; | ||
|
||
/** | ||
* Callbacks to customize the behavior of merging different format values from selected content | ||
* @param format The current retrieved format state | ||
* @param newValue The new format value to merge | ||
*/ | ||
export type MergeFormatValueCallbacks = { | ||
[K in keyof ContentModelFormatState]?: MergeFormatValueCallback; | ||
}; |