@superdoc-dev/react 1.6.1-next.2 → 1.6.1-next.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.d.ts +18 -13
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -4,6 +4,7 @@ import { ForwardRefExoticComponent } from 'react';
4
4
  import { ReactNode } from 'react';
5
5
  import { RefAttributes } from 'react';
6
6
  import { SuperDoc } from 'superdoc';
7
+ import { SuperDocExceptionPayload } from 'superdoc';
7
8
  import { Transaction } from 'superdoc';
8
9
 
9
10
  /**
@@ -84,13 +85,15 @@ export declare type SuperDocConfig = SuperDocConstructorConfig;
84
85
  /** SuperDoc constructor config - extracted from superdoc package */
85
86
  declare type SuperDocConstructorConfig = ConstructorParameters<typeof SuperDoc>[0];
86
87
 
87
- /** Event passed to onContentError callback */
88
- export declare interface SuperDocContentErrorEvent {
89
- error: Error;
90
- editor: Editor;
91
- documentId: string;
92
- file: File;
93
- }
88
+ /**
89
+ * Event passed to onContentError callback. Re-derived from the core
90
+ * `SuperDocConfig['onContentError']` parameter so the React wrapper
91
+ * cannot drift from the core contract: any widening or tightening
92
+ * upstream surfaces here automatically. See the core
93
+ * `Config.onContentError` JSDoc for the field semantics
94
+ * (`error: unknown`, `file: File | Blob | null | undefined`).
95
+ */
96
+ export declare type SuperDocContentErrorEvent = Parameters<NonNullable<SuperDocConfig['onContentError']>>[0];
94
97
 
95
98
  /**
96
99
  * SuperDocEditor component with forwardRef - Initializes SuperDoc instance and handles cleanup.
@@ -129,12 +132,14 @@ export declare interface SuperDocEditorUpdateEvent {
129
132
  sectionType?: string | null;
130
133
  }
131
134
 
132
- /** Event passed to onException callback */
133
- export declare interface SuperDocExceptionEvent {
134
- error: Error;
135
- editor?: Editor | null;
136
- code?: string;
137
- }
135
+ /**
136
+ * Event passed to onException callback. Re-exports the core union so
137
+ * the React wrapper matches what consumers receive when SuperDoc emits
138
+ * an `exception` event. The union has three runtime shapes (store init,
139
+ * restore failure, editor lifecycle); narrow with `'stage' in event`
140
+ * or `'code' in event` to access shape-specific fields.
141
+ */
142
+ export declare type SuperDocExceptionEvent = SuperDocExceptionPayload;
138
143
 
139
144
  /** SuperDoc instance type - from superdoc package */
140
145
  export declare type SuperDocInstance = InstanceType<typeof SuperDoc>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superdoc-dev/react",
3
- "version": "1.6.1-next.2",
3
+ "version": "1.6.1-next.4",
4
4
  "description": "Official React wrapper for the SuperDoc document editor",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",