UNPKG

@magnit-ceapp/taskboard-manager

Version:

An app to manage kanban-style task boards built as a custom html element

183 lines (159 loc) 6.15 kB
import { DataRecord } from 'record-setter'; import { RoutePageElement } from '@magnit-ce/path-router'; import { TaskListElement } from '@magnit-ce/task-list'; declare class BoardExport extends BoardExport_base { constructor(board?: TaskBoardRecord, taskSettings?: TaskSettingsRecord, backgroundImage?: CustomImageRecord, lists?: ListExport[]); } declare const BoardExport_base: new () => ExportedBoard; declare type ColorScheme = 'inherit' | 'browser' | 'light' | 'dark'; declare class CustomImageRecord extends DataRecord { boardId: string; isSingleBoard: boolean; name: string; description: string; image?: Blob; } declare type ExportedBoard = Partial<TaskBoardRecord> & { lists?: ExportedList[]; backgroundImage?: ExportedImage; taskSettings?: Partial<TaskSettingsRecord>; }; declare type ExportedImage = Partial<CustomImageRecord> & { image_base64?: string; }; declare type ExportedList = Partial<TaskListRecord> & { taskSettings?: Partial<TaskSettingsRecord>; tasks?: Partial<TaskRecord>[]; }; declare class ListExport extends ListExport_base { constructor(list?: ExportedList, taskSettings?: TaskSettingsRecord, tasks?: Partial<TaskRecord>[]); } declare const ListExport_base: new () => ExportedList; declare const TaskBoardBackgroundDisplay: { readonly Stretch: "stretch"; readonly Center: "center"; readonly Tile: "tile"; }; declare type TaskBoardBackgroundDisplayType = typeof TaskBoardBackgroundDisplay[keyof typeof TaskBoardBackgroundDisplay]; export declare class TaskboardManagerElement extends HTMLElement { #private; componentParts: Map<string, HTMLElement>; getElement<T extends HTMLElement | RoutePageElement = HTMLElement>(id: string): T; findElement<T extends HTMLElement | RoutePageElement = HTMLElement>(id: string): T; constructor(); /** * Initializes the app. * Not necessary if the `autolaunch` attribute was not set to `false`. */ init(): Promise<void>; setColorScheme(scheme: ColorScheme): void; undo(): Promise<void>; redo(): Promise<void>; refreshBoards(): Promise<void>; refreshCurrentBoard(): void; refreshBoardCollections(): Promise<void>; openBoard(id: string): Promise<void>; refreshBoard(): Promise<void>; closeBoard(): Promise<void>; addBoard(): Promise<TaskBoardRecord>; saveBoard(board: TaskBoardRecord): Promise<TaskBoardRecord>; deleteBoard(boardId: string): Promise<void>; getCurrentBoardId(): string | undefined; openBoardSettings(boardId: string): Promise<void>; updateBoardSettings(id: string): Promise<void>; exportBoard(id: string): Promise<void>; importBoard(boardData: BoardExport, errorMessage?: string): Promise<void>; removeBoard(boardId: string, confirm?: boolean): Promise<void>; duplicateBoard(id: string): Promise<void>; closeBoardSettings(): Promise<unknown>; clearData(confirm?: boolean): Promise<void>; addTask(list: TaskListElement, order: number): void; removeHistoryEntries(...ids: string[]): Promise<void>; static observedAttributes: string[]; attributeChangedCallback(attributeName: string, _oldValue: string, newValue: string): void; } declare class TaskBoardRecord extends DataRecord { name: string; color: string; order: number; backgroundImageId: string; backgroundDisplay: TaskBoardBackgroundDisplayType; backgroundOffsetX: number; backgroundOffsetY: number; useCustomBackgroundColor: boolean; backgroundColor: string; useCustomFontColor: boolean; fontColor: string; taskSettingsId: string; } declare type TaskBorderRadiusUnit = 'px' | '%'; declare const TaskColorDisplay: { readonly Hidden: "hidden"; readonly Element: "element"; readonly Borders: "border"; readonly TopBorder: "top-border"; readonly RightBorder: "right-border"; readonly BottomBorder: "bottom-border"; readonly LeftBorder: "left-border"; readonly Background: "background"; }; declare type TaskColorDisplayType = typeof TaskColorDisplay[keyof typeof TaskColorDisplay]; declare const TaskListColorDisplay: { readonly Element: "element"; readonly BorderColor: "border-color"; readonly FontColor: "font-color"; }; declare type TaskListColorDisplayType = typeof TaskListColorDisplay[keyof typeof TaskListColorDisplay]; declare class TaskListRecord extends DataRecord { boardId: string; taskSettingsId: string; category: string; order: number; color: string; name: string; colorDisplay: TaskListColorDisplayType; useCustomBackgroundColor: boolean; backgroundColor: string; useCustomFontColor: boolean; fontColor: string; useCustomWidth: boolean; width: number; isCollapsed: boolean; } declare class TaskRecord extends DataRecord { boardId: string; listId: string; order: number; color: string; description: string; isFinished: boolean; } declare type TaskSettingsParentRecordCategory = 'list' | 'board'; declare class TaskSettingsRecord extends DataRecord { parentRecordType: TaskSettingsParentRecordCategory; centerCheckbox: boolean; colorDisplay: TaskColorDisplayType; useCustomBackgroundColor: boolean; customBackgroundColor: string; useCustomFontSize: boolean; customFontSize: number; useCustomFontColor: boolean; customFontColor: string; useCustomWidth: boolean; customWidth: number; useCustomBorderWidth_top: boolean; borderWidth_top: number; useCustomBorderWidth_right: boolean; borderWidth_right: number; useCustomBorderWidth_bottom: boolean; borderWidth_bottom: number; useCustomBorderWidth_left: boolean; borderWidth_left: number; useCustomBorderRadius: boolean; borderRadiusValue: number; borderRadiusUnit: TaskBorderRadiusUnit; useCustomBorderColor: boolean; customBorderColor: string; centerRemoveButton: boolean; } export { }