diff --git a/packages/editor/api-report.md b/packages/editor/api-report.md index 2c664c832..30697333a 100644 --- a/packages/editor/api-report.md +++ b/packages/editor/api-report.md @@ -2653,7 +2653,7 @@ export { useComputed } export function useContainer(): HTMLDivElement; // @public (undocumented) -export const useEditor: () => Editor; +export function useEditor(): Editor; // @public (undocumented) export function useIsCropping(shapeId: TLShapeId): boolean; diff --git a/packages/editor/api/api.json b/packages/editor/api/api.json index 6492f6895..936c3a949 100644 --- a/packages/editor/api/api.json +++ b/packages/editor/api/api.json @@ -42130,32 +42130,33 @@ "name": "useContainer" }, { - "kind": "Variable", - "canonicalReference": "@tldraw/editor!useEditor:var", + "kind": "Function", + "canonicalReference": "@tldraw/editor!useEditor:function(1)", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", - "text": "useEditor: " - }, - { - "kind": "Content", - "text": "() => " + "text": "export declare function useEditor(): " }, { "kind": "Reference", "text": "Editor", "canonicalReference": "@tldraw/editor!Editor:class" + }, + { + "kind": "Content", + "text": ";" } ], "fileUrlPath": "packages/editor/src/lib/hooks/useEditor.ts", - "isReadonly": true, - "releaseTag": "Public", - "name": "useEditor", - "variableTypeTokenRange": { + "returnTypeTokenRange": { "startIndex": 1, - "endIndex": 3 - } + "endIndex": 2 + }, + "releaseTag": "Public", + "overloadIndex": 1, + "parameters": [], + "name": "useEditor" }, { "kind": "Function", diff --git a/packages/editor/src/lib/hooks/useEditor.ts b/packages/editor/src/lib/hooks/useEditor.ts index 49f5d3a59..8bc44cede 100644 --- a/packages/editor/src/lib/hooks/useEditor.ts +++ b/packages/editor/src/lib/hooks/useEditor.ts @@ -4,6 +4,6 @@ import { Editor } from '../editor/Editor' export const EditorContext = React.createContext({} as Editor) /** @public */ -export const useEditor = (): Editor => { +export function useEditor(): Editor { return React.useContext(EditorContext) }