From 381bc0ce4994f15ba95cbb4d0b6dac03666f797d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Ku=CC=88hn?= Date: Tue, 16 Feb 2021 18:28:43 +0100 Subject: [PATCH] refactoring --- packages/core/src/index.ts | 1 - packages/core/src/types.ts | 16 ++++------------ 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index 8b19b1bcd..5a620a6ac 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -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 {} diff --git a/packages/core/src/types.ts b/packages/core/src/types.ts index 16426428c..284c125cd 100644 --- a/packages/core/src/types.ts +++ b/packages/core/src/types.ts @@ -97,6 +97,10 @@ export type AnyObject = { [key: string]: any } +export type ValuesOf = T[keyof T]; + +export type KeysWithTypeOf = ({[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 -// ? ExtensionCommands -// : AllExtensions[Item] extends Node -// ? NodeCommands -// : AllExtensions[Item] extends Mark -// ? MarkCommands -// : never -// } - -export type ValuesOf = T[keyof T]; -export type KeysWithTypeOf = ({[P in keyof T]: T[P] extends Type ? P : never })[keyof T] export type UnionCommands = UnionToIntersection>>> export type Commands = {