import { CanvasRetrieve, PatchedCanvasUpdateRequest, Instance, CanvasCreateRequest } from '../../../../../types/openapi'; import { GetCanvasesParams } from '../../../../types/canvases'; import { PaginatedData } from '../../../../types/paginatedData'; import { AdminSelectCanvasesRequest, AdminSelectCanvasesResponse, AdminOpenCollectionPlayerOverlayRequest } from './types.admin'; /** * Creates a new canvas. * * @example * adminApi.createCanvas({ * name: 'my new canvas'; * }) */ export declare function createCanvas(payload: CanvasCreateRequest): Promise; /** * 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. * adminApi.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>; /** * Fetches a canvas by id with the defined fields or all of them. * * @example * // The `filters` object is a reserved payload key to transfer the metadata dict over the wire. * adminApi.getCanvas({ * fields: 'id,name,metadata', * }) */ export declare function getCanvas(payload: { id: CanvasRetrieve['id']; fields?: string; }): Promise; /** * Updates a canvas by ID and returns the defined fields or all of them. * * @example * // The fields param is appended to the URL as a query param. * onMounted(() => { * adminApi.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; /** * Opens a modal to view a canvas by ID. * * ``` * onMounted(() => { * adminApi.openCanvasOverlay({ * id: '01HH4RCBH631K4JDHWAQB0RPR6', * edit_mode: false, * fullscreen: true, * }) * }) * ``` * * You can also specify a position for the canvas overlay: * * ``` * adminApi.openCanvasOverlay({ * id: '01HH4RCBH631K4JDHWAQB0RPR6', * position: { * top: '10px', * left: '20px', * right: '20px', * bottom: '10px' * } * }) * ``` */ export declare function openCanvasOverlay(payload: { id: CanvasRetrieve['id']; edit_mode?: boolean; fullscreen?: boolean; component_id?: string; section_id?: string; position?: { left?: number | string; right?: number | string; top?: number | string; bottom?: number | string; }; }): Promise; /** * Opens a modal to display collection player content. * * @example * adminApi.openCollectionPlayerOverlay({ * name: 'My Collection', * groups: [ * { * id: 'file-id-1', * name: 'Group 1', * }, * { * id: 'group-2', * name: 'Group 2', * slides: [ * { file_id: 'file-id-2', slide_index: 0 }, * { file_id: 'file-id-3', slide_index: 1 }, * ], * }, * ], * }) */ export declare function openCollectionPlayerOverlay(payload: AdminOpenCollectionPlayerOverlayRequest): Promise; /** * Allows the user to select (and preselect) canvases from the instance. * * This method allows you to prompt the user to select canvases from the CatalogIQ * instance and use that canvas selection in your application. * * @example * const api = useApi() // or useAdmin() if you know that you 're in Admin context * api * .selectCanvases({ * allowed_types: ['canvas','canvas-template','section','section-template'] // default ['canvas'] * selections: [ * { id: "01HCZ623YYRFJQ0F7B69VWE510" }, * { id: "02HCZ623YYRFJQ0F7B69VWE510" }, * ], // default [] * }) * * @param payload optional payload to preselect specific canvases * @returns Promise with the user action and selected canvases */ export declare function selectCanvases(payload?: AdminSelectCanvasesRequest): Promise;