import { CanvasRetrieve, CanvasCreateRequest, PatchedCanvasUpdateRequest, SharedLink, Instance, CanvasRecommendedFiles, CanvasSection } from '../../../../types/openapi'; import { GetCanvasesParams, CanvasIndicator } from '../../../types/canvases'; import { PaginatedData } from '../../../types/paginatedData'; import { CanvasThemeRetrieve } from '../../../types/canvasTheme'; /** * Fetches a list of canvases to use in your app. * * @example * // The `filters` object is a reserved payload key to transfer the metadata dict over the wire. * api.getCanvases({ * search: 'my search query', * ordering: '-created_at', * filters: { * metadata__mydaterangefiltername__range: ['2023-12-10', '2023-12-22'], * metadata__mymultiselectfiltername: ['optionAValue', 'optionCValue'], * }, * fields: 'id,name,metadata', * }) */ export declare function getCanvases(payload: GetCanvasesParams & { filters?: Record; fields?: string; }): Promise>; export declare function createCanvas(payload: Omit): Promise; export declare function deleteCanvas(payload: { id: CanvasRetrieve['id']; }): Promise; /** * Updates a canvas by ID * * @example * // The fields param is appended to the URL as a query param. * onMounted(() => { * PitcherAPI.updateCanvas({ * id: '01HH4RCBH631K4JDHWAQB0RPR6', * fields: 'id,name', * name: 'To 3!', * }).then((res) => { * console.log(res) // logs: { id: '01HH4RCBH631K4JDHWAQB0RPR6', name: 'To 3!' } * }) * }) */ export declare function updateCanvas(payload: PatchedCanvasUpdateRequest & { id: CanvasRetrieve['id']; instance_id?: Instance['id']; fields?: string; }): Promise; /** * Updates canvas indicators by canvas ID. It merges the passed object into existing canvas indicators adding new keys if they were empty and overriding pre-existing keys. * * Indicators can also be updated using updateCanvas API but in this case passed object fully replaces existing indicators. * * @example * // The fields param is appended to the URL as a query param. * onMounted(() => { * PitcherAPI.updateCanvasIndicators({ * id: '01J9XT0WVXRTETF4CQZP42CPZP', * indicators: { * existing: { type: 'info', label: 'new label' }, // will be overriden * new: { type: 'info', label: 'INFO' }, // will be added * removeExisting: null // will be set to null and ignored, it is the same as removal * } * }).then((res) => { * console.log(res) // entire canvas object, including indicators field * }) * }) */ export declare function updateCanvasIndicators(payload: { indicators: Record; id: CanvasRetrieve['id']; instance_id?: Instance['id']; }): Promise; /** * Fetches a single canvas by ID. * * Pass `lazy_sections: true` to request the opt-in lazy "shell": when the * org/instance `lazy_load_sections` setting is also on, the response returns * ordered `section_ids` instead of the heavy inline `sections`, and you hydrate * section bodies on demand via {@link getSectionsByIds}. With the setting off * (or the param omitted) the response is the legacy fully-expanded canvas. */ export declare function getCanvas(payload: { id: CanvasRetrieve['id']; fields?: string; lazy_sections?: boolean; }): Promise; /** * Batch-hydrate section bodies for a canvas fetched as a lazy shell. * * Companion to `getCanvas({ lazy_sections: true })`: pass the canvas ID and a * slice of its `section_ids` (≤100 per call) and receive the full section * bodies, serialized identically to a normal canvas retrieve's inline * `sections`. Only sections actually referenced by the canvas are returned. * * Pass the SAME `exclude_drafts` / `include_expired_files` / `include_pending_files` * the shell was fetched with so hydration filters identically to the shell that * advertised the IDs — otherwise admin decks (fetched with `exclude_drafts:false`, * expired/pending on) list draft/expired sections the batch would silently drop, * leaving them blank. Omit them to get the rep defaults (drafts excluded, * expired/pending off). `include_expired_files`/`include_pending_files` are * server-side role-gated (admin/editor only), matching the inline retrieve. * * @example * const { sections } = await api.getSectionsByIds({ * canvas_id: '01HH4RCBH631K4JDHWAQB0RPR6', * section_ids: ['01SEC...', '02SEC...'], * }) */ export declare function getSectionsByIds(payload: { canvas_id: CanvasRetrieve['id']; section_ids: string[]; exclude_drafts?: boolean; include_expired_files?: boolean; include_pending_files?: boolean; }): Promise<{ sections: CanvasSection[]; }>; export declare function shareCanvas(payload: { id: CanvasRetrieve['id']; }): Promise; export declare function getCanvasRecommendedFiles(payload: { canvas_id: CanvasRetrieve['id']; match?: ('tags' | 'metadata')[]; }): Promise; export declare function getCanvasTheme(payload: { canvas_id: CanvasRetrieve['id']; }): Promise; export declare function unassignCanvasTheme(payload: { canvas_id: CanvasRetrieve['id']; }): Promise;