Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
zbeyens committed Nov 20, 2024
1 parent ca93b4c commit d9b09fd
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
9 changes: 5 additions & 4 deletions packages/core/src/lib/plugin/SlatePlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,13 @@ export type SlatePlugin<C extends AnyPluginConfig = PluginConfig> =
plugins?: Record<string, Partial<EditorPlugin<AnyPluginConfig>>>;
};
parsers:
| ({
[K in string]: {
| (Record<
string,
{
deserializer?: Deserializer<WithAnyKey<C>>;
serializer?: Serializer<WithAnyKey<C>>;
};
} & { html?: never })
}
> & { html?: never })
| {
html?: Nullable<{
deserializer?: HtmlDeserializer<WithAnyKey<C>>;
Expand Down
9 changes: 5 additions & 4 deletions packages/core/src/react/plugin/PlatePlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,15 @@ export type PlatePlugin<C extends AnyPluginConfig = PluginConfig> =
};

parsers:
| ({
[K in string]: {
| (Record<
string,
{
/** @see {@link Deserializer} */
deserializer?: Deserializer<WithAnyKey<C>>;
/** @see {@link Serializer} */
serializer?: Serializer<WithAnyKey<C>>;
};
} & { html?: never; htmlReact?: never })
}
> & { html?: never; htmlReact?: never })
| {
html?: Nullable<{
/** @see {@link HtmlDeserializer} */
Expand Down
10 changes: 4 additions & 6 deletions packages/markdown/src/lib/remark-slate/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,16 @@ export type RemarkElementRule = {
) => TElement | TElement[];
};

export type RemarkElementRules = {
[key in MdastElementType]?: RemarkElementRule;
};
export type RemarkElementRules = Partial<
Record<MdastElementType, RemarkElementRule>
>;

export type RemarkTextRule = {
mark?: (options: RemarkPluginOptions) => string;
transform?: (text: string) => string;
};

export type RemarkTextRules = {
[key in MdastTextType]?: RemarkTextRule;
};
export type RemarkTextRules = Partial<Record<MdastTextType, RemarkTextRule>>;

export type RemarkPluginOptions = {
editor: SlateEditor;
Expand Down

0 comments on commit d9b09fd

Please sign in to comment.