mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-04-14 16:40:58 -04:00
22 lines
573 B
TypeScript
22 lines
573 B
TypeScript
import React from "react";
|
|
|
|
export type SidebarProps<P = {}> = {
|
|
children: React.ReactNode;
|
|
/**
|
|
* Called on sidebar close (either by user action or by the editor).
|
|
*/
|
|
onClose?: () => void | boolean;
|
|
/** if not supplied, sidebar won't be dockable */
|
|
onDock?: (docked: boolean) => void;
|
|
docked?: boolean;
|
|
dockable?: boolean;
|
|
className?: string;
|
|
} & P;
|
|
|
|
export type SidebarPropsContextValue = Pick<
|
|
SidebarProps,
|
|
"onClose" | "onDock" | "docked" | "dockable"
|
|
>;
|
|
|
|
export const SidebarPropsContext =
|
|
React.createContext<SidebarPropsContextValue>({});
|