mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-12-18 13:07:55 +08:00
refactoring
This commit is contained in:
parent
02e91daed2
commit
381bc0ce49
@ -21,5 +21,4 @@ export { default as isTextSelection } from './helpers/isTextSelection'
|
||||
export { default as isCellSelection } from './helpers/isCellSelection'
|
||||
export { default as findParentNodeClosestToPos } from './helpers/findParentNodeClosestToPos'
|
||||
|
||||
export interface AllExtensions {}
|
||||
export interface AllCommands {}
|
||||
|
@ -97,6 +97,10 @@ export type AnyObject = {
|
||||
[key: string]: any
|
||||
}
|
||||
|
||||
export type ValuesOf<T> = T[keyof T];
|
||||
|
||||
export type KeysWithTypeOf<T, Type> = ({[P in keyof T]: T[P] extends Type ? P : never })[keyof T]
|
||||
|
||||
export type NodeViewRendererProps = {
|
||||
editor: Editor,
|
||||
node: ProseMirrorNode,
|
||||
@ -108,18 +112,6 @@ export type NodeViewRendererProps = {
|
||||
|
||||
export type NodeViewRenderer = (props: NodeViewRendererProps) => (NodeView | {})
|
||||
|
||||
// export type UnfilteredCommands = {
|
||||
// [Item in keyof AllExtensions]: AllExtensions[Item] extends Extension<any, infer ExtensionCommands>
|
||||
// ? ExtensionCommands
|
||||
// : AllExtensions[Item] extends Node<any, infer NodeCommands>
|
||||
// ? NodeCommands
|
||||
// : AllExtensions[Item] extends Mark<any, infer MarkCommands>
|
||||
// ? MarkCommands
|
||||
// : never
|
||||
// }
|
||||
|
||||
export type ValuesOf<T> = T[keyof T];
|
||||
export type KeysWithTypeOf<T, Type> = ({[P in keyof T]: T[P] extends Type ? P : never })[keyof T]
|
||||
export type UnionCommands = UnionToIntersection<ValuesOf<Pick<AllCommands, KeysWithTypeOf<AllCommands, {}>>>>
|
||||
|
||||
export type Commands = {
|
||||
|
Loading…
Reference in New Issue
Block a user