@web-noise/core 0.0.5 → 0.0.7

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.
package/dist/types.d.ts CHANGED
@@ -167,12 +167,19 @@ export interface EditorStoreState extends GraphState {
167
167
  export interface EditorState extends EditorStoreState {
168
168
  viewport: Viewport;
169
169
  }
170
- type ProjectFile = {
170
+ interface EditorFile {
171
171
  id: string;
172
172
  name?: string;
173
- type?: "patch" | "blob";
173
+ type: "patch" | never;
174
174
  file: EditorState;
175
- };
175
+ }
176
+ interface AudioFile {
177
+ id: string;
178
+ name?: string;
179
+ type: "audio";
180
+ file: string;
181
+ }
182
+ type ProjectFile = EditorFile | AudioFile;
176
183
  export interface Project {
177
184
  files: Array<ProjectFile>;
178
185
  }
@@ -242,11 +249,14 @@ interface AudioPatchState {
242
249
  patch: Patch;
243
250
  nodesState: Record<string, any>;
244
251
  }
252
+ export const isPatch: (file: ProjectFile) => file is EditorFile;
253
+ export const isAudio: (file: ProjectFile) => file is AudioFile;
245
254
  interface ProjectState {
246
255
  project: Project;
247
256
  setProject: (project: Project) => void;
248
257
  getProject: () => Project;
249
258
  pullEditorChanges: () => void;
259
+ syncEditorWithCurrentFile: () => void;
250
260
  currentFileIndex: number;
251
261
  setCurrentFileIndex: (index: number) => void;
252
262
  updateFileContent: (fileIndex: number, file: ProjectFile) => void;
@@ -326,12 +336,13 @@ export const EDITOR_DEFAULTS: {
326
336
  zoom: number;
327
337
  };
328
338
  };
329
- export const Editor: ({ ...props }: {
339
+ interface AppProps {
330
340
  projectState?: Project;
331
341
  plugins?: Array<PluginConfig>;
332
342
  editorContextMenu?: Array<ReactNode>;
333
343
  onChange?: ({ nodes, edges, controlPanel }: EditorState) => void;
334
344
  theme?: Theme;
335
- }) => JSX.Element;
345
+ }
346
+ export const Editor: ({ ...props }: AppProps) => JSX.Element;
336
347
 
337
348
  //# sourceMappingURL=types.d.ts.map