MCPcopy Index your code
hub / github.com/callumalpass/tasknotes / openTaskSelector

Function openTaskSelector

src/modals/TaskSelectorWithCreateModal.ts:694–713  ·  view source on GitHub ↗
(
	plugin: TaskNotesPlugin,
	tasks: TaskInfo[],
	onChooseTask: (task: TaskInfo | null) => void,
	options?: { placeholder?: string; title?: string; targetDate?: Date }
)

Source from the content-addressed store, hash-verified

692 * @param options - Optional configuration (placeholder, title)
693 */
694export function openTaskSelector(
695 plugin: TaskNotesPlugin,
696 tasks: TaskInfo[],
697 onChooseTask: (task: TaskInfo | null) => void,
698 options?: { placeholder?: string; title?: string; targetDate?: Date }
699): void {
700 const modal = new TaskSelectorWithCreateModal(plugin.app, plugin, tasks, {
701 placeholder: options?.placeholder,
702 title: options?.title,
703 targetDate: options?.targetDate,
704 onResult: (result) => {
705 if (result.type === "selected" || result.type === "created") {
706 onChooseTask(result.task);
707 } else {
708 onChooseTask(null);
709 }
710 },
711 });
712 modal.open();
713}

Calls 1

openMethod · 0.45

Tested by

no test coverage detected