Something went wrong. Try again.
A local-first note taking app
Something went wrong. Try again.
TypeScript
123456789101112131415161718192021222324252627import type { ActionSet, ActionDefinition } from '../types';
/** * ActionSet for sidebar chrome actions. */export class SidebarActionSet implements ActionSet { readonly id = 'sidebar';
constructor( private setSidebarOpen: ( open: boolean | ((prev: boolean) => boolean), ) => void, ) {}
getActions(): ActionDefinition[] { return [ { id: 'toggle', name: 'Toggle sidebar', description: 'Show or hide the file sidebar', hotkeys: [{ modifiers: ['Mod'], key: 'b' }], execute: () => this.setSidebarOpen((prev) => !prev), }, ]; }}