$node-schema.d.ts 747 B

12345678910111213141516171819
  1. import type { Ctx, MilkdownPlugin } from '@milkdown/ctx';
  2. import type { NodeSchema } from '@milkdown/transformer';
  3. import type { $Ctx } from '../$ctx';
  4. import type { $Node } from '../$node';
  5. export type GetNodeSchema = (ctx: Ctx) => NodeSchema;
  6. export type $NodeSchema<T extends string> = [
  7. schemaCtx: $Ctx<GetNodeSchema, T>,
  8. schema: $Node
  9. ] & {
  10. id: $Node['id'];
  11. type: $Node['type'];
  12. node: $Node;
  13. ctx: $Ctx<GetNodeSchema, T>;
  14. schema: NodeSchema;
  15. key: $Ctx<GetNodeSchema, T>['key'];
  16. extendSchema: (handler: (prev: GetNodeSchema) => GetNodeSchema) => MilkdownPlugin;
  17. };
  18. export declare function $nodeSchema<T extends string>(id: T, schema: GetNodeSchema): $NodeSchema<T>;
  19. //# sourceMappingURL=$node-schema.d.ts.map