@hastycapybara/tasks-api 0.0.0-stage → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/NOTICE.md +23 -0
- package/README.md +26 -2
- package/index.d.ts +305 -0
- package/package.json +33 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 HastyCapybara (W.Leester)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/NOTICE.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# 제3자 고지 (Third-party notices)
|
|
2
|
+
|
|
3
|
+
## Obsidian Tasks
|
|
4
|
+
|
|
5
|
+
`src/core/`의 태스크 파싱·직렬화, 반복(recurrence), 긴급도(urgency), 쿼리 로직 일부는
|
|
6
|
+
[Obsidian Tasks](https://github.com/obsidian-tasks-group/obsidian-tasks)에서 이식했거나 그 구현을 참고했습니다.
|
|
7
|
+
Copyright (c) 2021 Martin Schenck and Clare Macrae, MIT 라이선스.
|
|
8
|
+
|
|
9
|
+
이식한 파일에는 상단 주석으로 출처를 표시했습니다:
|
|
10
|
+
`src/core/recurrence/Recurrence.ts`, `src/core/task/Urgency.ts`, `src/core/task/statusPresets.ts`,
|
|
11
|
+
`tests/core/task/obsidian-port.test.ts`, `tests/core/recurrence/Recurrence.test.ts`, `tests/core/task/Urgency.test.ts`.
|
|
12
|
+
|
|
13
|
+
MIT 라이선스 전문은 `LICENSE`와 같습니다. 이 프로젝트는 Obsidian Tasks 프로젝트나 Obsidian(Dynalist Inc.)과
|
|
14
|
+
관련이 없으며, 그들의 보증을 받지 않았습니다.
|
|
15
|
+
|
|
16
|
+
## 런타임 의존성
|
|
17
|
+
|
|
18
|
+
| 패키지 | 라이선스 | 용도 |
|
|
19
|
+
|---|---|---|
|
|
20
|
+
| [dayjs](https://github.com/iamkun/dayjs) | MIT | 날짜 계산 |
|
|
21
|
+
| [rrule](https://github.com/jkbrzt/rrule) | BSD-3-Clause | 반복 규칙 해석 |
|
|
22
|
+
| [ignore](https://github.com/kaelzhang/node-ignore) | MIT | `.gitignore` 규칙 적용 |
|
|
23
|
+
| [svelte](https://github.com/sveltejs/svelte) (웹뷰 번들에 포함) | MIT | 웹뷰 UI |
|
package/README.md
CHANGED
|
@@ -1,3 +1,27 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @hastycapybara/tasks-api
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
TypeScript types for the public API of **[Tasks for Markdown](https://github.com/W-Leester/tasks-for-markdown)**, the Obsidian Tasks-compatible task manager for VS Code and Cursor. Types only — the API itself is provided by the installed extension.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npm i -D @hastycapybara/tasks-api
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import * as vscode from 'vscode';
|
|
11
|
+
import type { TasksExtensionExports, TasksApi } from '@hastycapybara/tasks-api';
|
|
12
|
+
|
|
13
|
+
const ext = vscode.extensions.getExtension<TasksExtensionExports>('HastyCapybara.tasks-for-markdown');
|
|
14
|
+
if (!ext) throw new Error('Tasks for Markdown is not installed');
|
|
15
|
+
const tasks: TasksApi = (await ext.activate()).getAPI(1, { extensionId: 'my-publisher.my-extension' });
|
|
16
|
+
|
|
17
|
+
const due = await tasks.query.run('not done\ndue before tomorrow\nsort by urgency');
|
|
18
|
+
if (tasks.features.includes('notes.add')) await tasks.edit.addNote({ path: due.tasks[0].path, line: due.tasks[0].line }, 'Started');
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Check optional capabilities with `tasks.features` (or `await tasks.info()`), not by version number.
|
|
22
|
+
|
|
23
|
+
- API reference: [docs/api.en.md](https://github.com/W-Leester/tasks-for-markdown/blob/main/docs/api.en.md) (Korean: [docs/api.md](https://github.com/W-Leester/tasks-for-markdown/blob/main/docs/api.md))
|
|
24
|
+
- The same types are in the repository as one self-contained file: [src/api/types.ts](https://github.com/W-Leester/tasks-for-markdown/blob/main/src/api/types.ts)
|
|
25
|
+
- Outside the editor, use the CLI / MCP server [`@hastycapybara/tasks-cli`](https://www.npmjs.com/package/@hastycapybara/tasks-cli) or the library [`@hastycapybara/tasks-core`](https://www.npmjs.com/package/@hastycapybara/tasks-core).
|
|
26
|
+
|
|
27
|
+
MIT. Task syntax and query language come from [Obsidian Tasks](https://github.com/obsidian-tasks-group/obsidian-tasks) (MIT); see NOTICE.md.
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public API of Tasks for Markdown (v1). Other extensions get it with
|
|
3
|
+
*
|
|
4
|
+
* const ext = vscode.extensions.getExtension('HastyCapybara.tasks-for-markdown');
|
|
5
|
+
* const api = (await ext.activate()).getAPI(1, { extensionId: 'my.extension' });
|
|
6
|
+
*
|
|
7
|
+
* Everything here is plain JSON: dates are `YYYY-MM-DD` strings, a task is addressed by its
|
|
8
|
+
* workspace-relative path and 0-based line. No `vscode` types leak through this file, so it can
|
|
9
|
+
* be copied into another project as a `.d.ts`. Keep it that way: **no imports** in this file (a test
|
|
10
|
+
* checks), and the data shapes below must match the internal DTOs exactly (a type test checks).
|
|
11
|
+
*/
|
|
12
|
+
/** A task as JSON — what queries return and edits resolve to. Dates are `YYYY-MM-DD` or null. */
|
|
13
|
+
export interface TaskDto {
|
|
14
|
+
/** Index key of the file (a URI string in the extension; the path in the CLI/MCP). With `line`, identifies the task for edits. */
|
|
15
|
+
key: string;
|
|
16
|
+
/** Workspace-relative path. */
|
|
17
|
+
path: string;
|
|
18
|
+
/** 0-based line number. */
|
|
19
|
+
line: number;
|
|
20
|
+
/** Nearest heading above the task (without `#`), or null. */
|
|
21
|
+
heading: string | null;
|
|
22
|
+
/** Line of the parent list item (task or bullet) in the same file, or null; see depth. */
|
|
23
|
+
parentLine: number | null;
|
|
24
|
+
/** Nesting depth: 0 = top-level list item. */
|
|
25
|
+
depth: number;
|
|
26
|
+
/** Notes: the task's direct child bullets without a checkbox, with their lines. */
|
|
27
|
+
notes: {
|
|
28
|
+
line: number;
|
|
29
|
+
text: string;
|
|
30
|
+
}[];
|
|
31
|
+
/** Task text without the field emojis (tags included). */
|
|
32
|
+
description: string;
|
|
33
|
+
/** `type` is TODO, IN_PROGRESS, ON_HOLD, DONE, CANCELLED or NON_TASK. */
|
|
34
|
+
status: {
|
|
35
|
+
symbol: string;
|
|
36
|
+
name: string;
|
|
37
|
+
type: string;
|
|
38
|
+
};
|
|
39
|
+
/** '0' (highest) … '3' (none) … '5' (lowest). */
|
|
40
|
+
priority: string;
|
|
41
|
+
priorityName: string;
|
|
42
|
+
created: string | null;
|
|
43
|
+
start: string | null;
|
|
44
|
+
scheduled: string | null;
|
|
45
|
+
due: string | null;
|
|
46
|
+
done: string | null;
|
|
47
|
+
cancelled: string | null;
|
|
48
|
+
/** Recurrence rule text such as `every week`, or null. */
|
|
49
|
+
recurrence: string | null;
|
|
50
|
+
onCompletion: string | null;
|
|
51
|
+
/** 🆔 of this task, or null. */
|
|
52
|
+
id: string | null;
|
|
53
|
+
/** ⛔ ids this task waits for. */
|
|
54
|
+
dependsOn: string[];
|
|
55
|
+
tags: string[];
|
|
56
|
+
/** Done or cancelled. */
|
|
57
|
+
isCompleted: boolean;
|
|
58
|
+
/** Done (not cancelled). */
|
|
59
|
+
isDone: boolean;
|
|
60
|
+
/** Waiting for an unfinished task it depends on (⛔). */
|
|
61
|
+
isBlocked: boolean;
|
|
62
|
+
/** Another unfinished task depends on this one — finishing it unblocks something. */
|
|
63
|
+
isBlocking: boolean;
|
|
64
|
+
/** Obsidian Tasks' urgency score. */
|
|
65
|
+
urgency: number;
|
|
66
|
+
/** The whole line as it is in the file — pass it back as `expectedText` to guard edits. */
|
|
67
|
+
originalMarkdown: string;
|
|
68
|
+
}
|
|
69
|
+
/** A group of query results (`group by`). */
|
|
70
|
+
export interface GroupDto {
|
|
71
|
+
name: string;
|
|
72
|
+
count: number;
|
|
73
|
+
children: GroupDto[];
|
|
74
|
+
tasks: TaskDto[];
|
|
75
|
+
/** Tree display (leaf groups only): `tasks` nested by parent task, with context children (`matched: false`). */
|
|
76
|
+
tree?: TreeDto[];
|
|
77
|
+
}
|
|
78
|
+
export interface TreeDto {
|
|
79
|
+
task: TaskDto;
|
|
80
|
+
/** False for a context row: shown with its parent although it did not match the query. */
|
|
81
|
+
matched: boolean;
|
|
82
|
+
children: TreeDto[];
|
|
83
|
+
}
|
|
84
|
+
export interface SavedQueryDto {
|
|
85
|
+
id: string;
|
|
86
|
+
name: string;
|
|
87
|
+
query: string;
|
|
88
|
+
source: 'settings' | 'file';
|
|
89
|
+
}
|
|
90
|
+
export type ApiErrorCode = 'STALE_LINE' | 'NOT_FOUND' | 'INVALID_QUERY' | 'INVALID_ARGUMENT' | 'UNTRUSTED' | 'DENIED' | 'IO';
|
|
91
|
+
export interface ApiError {
|
|
92
|
+
code: ApiErrorCode;
|
|
93
|
+
message: string;
|
|
94
|
+
details?: unknown;
|
|
95
|
+
}
|
|
96
|
+
/** Who is calling; shown in the write-confirmation dialog and in the log. */
|
|
97
|
+
export interface ApiCaller {
|
|
98
|
+
/** `publisher.name` of the calling extension. */
|
|
99
|
+
extensionId?: string;
|
|
100
|
+
}
|
|
101
|
+
/** A task's address. `expectedText` (the exact source line) makes writes fail with STALE_LINE if the line changed. */
|
|
102
|
+
export interface TaskRef {
|
|
103
|
+
path: string;
|
|
104
|
+
line: number;
|
|
105
|
+
expectedText?: string;
|
|
106
|
+
}
|
|
107
|
+
/** Priority as in the query language: '0' highest … '3' none … '5' lowest. */
|
|
108
|
+
export type PriorityValue = '0' | '1' | '2' | '3' | '4' | '5';
|
|
109
|
+
export interface TaskFieldChanges {
|
|
110
|
+
description?: string;
|
|
111
|
+
priority?: PriorityValue;
|
|
112
|
+
/** `YYYY-MM-DD`, or null to remove the date. */
|
|
113
|
+
due?: string | null;
|
|
114
|
+
scheduled?: string | null;
|
|
115
|
+
start?: string | null;
|
|
116
|
+
created?: string | null;
|
|
117
|
+
done?: string | null;
|
|
118
|
+
cancelled?: string | null;
|
|
119
|
+
/** Recurrence text such as `every week on monday`, or null to remove. */
|
|
120
|
+
recurrence?: string | null;
|
|
121
|
+
/** `keep` | `delete`, or null. */
|
|
122
|
+
onCompletion?: string | null;
|
|
123
|
+
id?: string | null;
|
|
124
|
+
/** Ids of tasks this one depends on. */
|
|
125
|
+
dependsOn?: string[];
|
|
126
|
+
/** Status symbol (the character inside `[ ]`); applied last, with done/cancelled dates and recurrence. */
|
|
127
|
+
status?: string;
|
|
128
|
+
/** Replace the task's notes (indented plain bullets under it), one entry per note; `[]` removes them. */
|
|
129
|
+
notes?: string[];
|
|
130
|
+
}
|
|
131
|
+
export interface NewTask extends TaskFieldChanges {
|
|
132
|
+
description: string;
|
|
133
|
+
/** Tags to append to the description (with or without the leading `#`). */
|
|
134
|
+
tags?: string[];
|
|
135
|
+
}
|
|
136
|
+
export interface CreateTarget {
|
|
137
|
+
/** Workspace-relative Markdown file. Created if it does not exist. Defaults to `tasksmd.calendar.newTaskFile`. */
|
|
138
|
+
path?: string;
|
|
139
|
+
/** Insert after this 0-based line (a blank line is replaced). Omit to append at the end of the file. */
|
|
140
|
+
line?: number;
|
|
141
|
+
}
|
|
142
|
+
export interface QueryRunOptions {
|
|
143
|
+
/** Workspace-relative path of the "current file" for `{{query.file.*}}` placeholders. */
|
|
144
|
+
source?: string;
|
|
145
|
+
/** Cap on tasks returned (same as a `limit N` line). */
|
|
146
|
+
limit?: number;
|
|
147
|
+
}
|
|
148
|
+
export interface QueryRunResult {
|
|
149
|
+
/** Tasks after filtering, before limits. */
|
|
150
|
+
matched: number;
|
|
151
|
+
/** Tasks returned (after limits). */
|
|
152
|
+
shown: number;
|
|
153
|
+
/** All returned tasks in result order, flattened even when grouped. */
|
|
154
|
+
tasks: TaskDto[];
|
|
155
|
+
/** Group tree when the query has `group by`, else null. */
|
|
156
|
+
groups: GroupDto | null;
|
|
157
|
+
/** Errors raised by `by function` instructions at run time. */
|
|
158
|
+
runtimeErrors: string[];
|
|
159
|
+
}
|
|
160
|
+
export interface QueryError {
|
|
161
|
+
line: number;
|
|
162
|
+
text: string;
|
|
163
|
+
message: string;
|
|
164
|
+
}
|
|
165
|
+
export interface ExplainResult {
|
|
166
|
+
explain: string;
|
|
167
|
+
errors: QueryError[];
|
|
168
|
+
}
|
|
169
|
+
export type EditOp = {
|
|
170
|
+
op: 'create';
|
|
171
|
+
input: NewTask;
|
|
172
|
+
target?: CreateTarget;
|
|
173
|
+
} | {
|
|
174
|
+
op: 'update';
|
|
175
|
+
ref: TaskRef;
|
|
176
|
+
changes: TaskFieldChanges;
|
|
177
|
+
} | {
|
|
178
|
+
op: 'setStatus';
|
|
179
|
+
ref: TaskRef;
|
|
180
|
+
symbol: string;
|
|
181
|
+
} | {
|
|
182
|
+
op: 'toggle';
|
|
183
|
+
ref: TaskRef;
|
|
184
|
+
} | {
|
|
185
|
+
op: 'postpone';
|
|
186
|
+
ref: TaskRef;
|
|
187
|
+
to: string;
|
|
188
|
+
} | {
|
|
189
|
+
op: 'addNote';
|
|
190
|
+
ref: TaskRef;
|
|
191
|
+
text: string;
|
|
192
|
+
} | {
|
|
193
|
+
op: 'remove';
|
|
194
|
+
ref: TaskRef;
|
|
195
|
+
};
|
|
196
|
+
export interface BatchResult {
|
|
197
|
+
/** One entry per op, in order: the resulting task, or null for `remove`. */
|
|
198
|
+
results: (TaskDto | null)[];
|
|
199
|
+
}
|
|
200
|
+
export interface TasksChangeEvent {
|
|
201
|
+
/** Workspace-relative paths of files whose tasks changed or were removed. */
|
|
202
|
+
paths: string[];
|
|
203
|
+
}
|
|
204
|
+
export interface TaskCompletedEvent {
|
|
205
|
+
task: TaskDto;
|
|
206
|
+
/** The next occurrence written for a recurring task, if any. */
|
|
207
|
+
next?: TaskDto;
|
|
208
|
+
}
|
|
209
|
+
export interface TaskStatusChangeEvent {
|
|
210
|
+
/** The task before the change. */
|
|
211
|
+
before: TaskDto;
|
|
212
|
+
/** The task after the change (its line as written; for 🏁 delete this is the removed task). */
|
|
213
|
+
after: TaskDto;
|
|
214
|
+
/** The next occurrence written for a recurring task, if any. */
|
|
215
|
+
next?: TaskDto;
|
|
216
|
+
/** True when the task line was deleted (🏁 delete on completion). */
|
|
217
|
+
deleted: boolean;
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Names of optional capabilities, so a caller can check what the installed extension supports
|
|
221
|
+
* (all within API version 1). See docs/api.md "Feature list" for the version each was added in.
|
|
222
|
+
*/
|
|
223
|
+
export type ApiFeature = 'tree' | 'notes' | 'notes.add' | 'info' | 'events.status' | 'isBlocking';
|
|
224
|
+
export interface ApiInfo {
|
|
225
|
+
/** Version of the installed extension, e.g. `1.0.0`. */
|
|
226
|
+
extensionVersion: string;
|
|
227
|
+
apiVersion: 1;
|
|
228
|
+
features: ApiFeature[];
|
|
229
|
+
/** Settings that change what edits are accepted or how lines are written. */
|
|
230
|
+
settings: {
|
|
231
|
+
/** `tasksmd.requireDueDate` (default true): `edit.create` rejects a task without `due`. */
|
|
232
|
+
requireDueDate: boolean;
|
|
233
|
+
/** `tasksmd.taskFormat`: how fields are written. */
|
|
234
|
+
taskFormat: 'emoji' | 'dataview';
|
|
235
|
+
/** `tasksmd.globalFilter`: only lines containing it are tasks ('' = off). */
|
|
236
|
+
globalFilter: string;
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
export interface ApiDisposable {
|
|
240
|
+
dispose(): void;
|
|
241
|
+
}
|
|
242
|
+
export interface TasksApi {
|
|
243
|
+
readonly version: 1;
|
|
244
|
+
/** Version of the installed extension, e.g. `1.0.0`. */
|
|
245
|
+
readonly extensionVersion: string;
|
|
246
|
+
/** Optional capabilities this build supports — check before using a newer field or method. */
|
|
247
|
+
readonly features: readonly ApiFeature[];
|
|
248
|
+
/** Version, features and the settings that affect edits (e.g. whether a due date is required). */
|
|
249
|
+
info(): Promise<ApiInfo>;
|
|
250
|
+
query: {
|
|
251
|
+
/** Run query text (the same language as ```tasks blocks). Rejects with INVALID_QUERY on parse errors. */
|
|
252
|
+
run(query: string, options?: QueryRunOptions): Promise<QueryRunResult>;
|
|
253
|
+
/** Parse only: the human-readable explanation and any errors. */
|
|
254
|
+
explain(query: string, source?: string): Promise<ExplainResult>;
|
|
255
|
+
/** One task, or null when nothing is at that line. */
|
|
256
|
+
get(ref: TaskRef): Promise<TaskDto | null>;
|
|
257
|
+
/** Every indexed task (optionally only from these files), in file order. */
|
|
258
|
+
list(options?: {
|
|
259
|
+
paths?: string[];
|
|
260
|
+
}): Promise<TaskDto[]>;
|
|
261
|
+
/** Saved queries (settings + `.tasks/queries/*.md`). */
|
|
262
|
+
saved(): Promise<SavedQueryDto[]>;
|
|
263
|
+
};
|
|
264
|
+
edit: {
|
|
265
|
+
create(input: NewTask, target?: CreateTarget): Promise<TaskDto>;
|
|
266
|
+
update(ref: TaskRef, changes: TaskFieldChanges): Promise<TaskDto>;
|
|
267
|
+
/** Set the status symbol; done/cancelled dates and the next recurrence are handled like a click in the UI. */
|
|
268
|
+
setStatus(ref: TaskRef, symbol: string): Promise<TaskDto>;
|
|
269
|
+
/** Move to the status' configured next symbol. */
|
|
270
|
+
toggle(ref: TaskRef): Promise<TaskDto>;
|
|
271
|
+
/** Move the due date (or scheduled date if there is no due date) to `YYYY-MM-DD` or natural language ("tomorrow", "next monday", "in 2 weeks"). */
|
|
272
|
+
postpone(ref: TaskRef, to: string): Promise<TaskDto>;
|
|
273
|
+
/** Delete the task line. */
|
|
274
|
+
remove(ref: TaskRef): Promise<void>;
|
|
275
|
+
/** Add one note (an indented bullet) under the task, after its existing notes. Returns the task with its notes. */
|
|
276
|
+
addNote(ref: TaskRef, text: string): Promise<TaskDto>;
|
|
277
|
+
/** Run several edits in order. Stops at the first failure; the error's `details` says how many completed. */
|
|
278
|
+
batch(ops: EditOp[]): Promise<BatchResult>;
|
|
279
|
+
};
|
|
280
|
+
events: {
|
|
281
|
+
onDidChangeTasks(listener: (e: TasksChangeEvent) => void): ApiDisposable;
|
|
282
|
+
onDidCompleteTask(listener: (e: TaskCompletedEvent) => void): ApiDisposable;
|
|
283
|
+
/** Every status change (done, cancelled, in progress, reopened…) from the editor, sidebar, views or the API. */
|
|
284
|
+
onDidChangeStatus(listener: (e: TaskStatusChangeEvent) => void): ApiDisposable;
|
|
285
|
+
};
|
|
286
|
+
ui: {
|
|
287
|
+
/** The create/edit dialog; without a ref it creates a new task. */
|
|
288
|
+
openEdit(ref?: TaskRef): Promise<void>;
|
|
289
|
+
openKanban(options?: {
|
|
290
|
+
savedQueryId?: string;
|
|
291
|
+
mode?: 'status' | 'due' | 'priority' | 'file';
|
|
292
|
+
}): Promise<void>;
|
|
293
|
+
openCalendar(options?: {
|
|
294
|
+
fullScreen?: boolean;
|
|
295
|
+
}): Promise<void>;
|
|
296
|
+
/** The query results panel beside the editor, showing this query. */
|
|
297
|
+
openQueryResults(query: string, source?: string): Promise<void>;
|
|
298
|
+
/** Open the task's file in the text editor at its line. */
|
|
299
|
+
reveal(ref: TaskRef): Promise<void>;
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
/** What `vscode.extensions.getExtension(...).exports` resolves to. */
|
|
303
|
+
export interface TasksExtensionExports {
|
|
304
|
+
getAPI(version: 1, caller?: ApiCaller): TasksApi;
|
|
305
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,36 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hastycapybara/tasks-api",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "TypeScript types for the public API of the Tasks for Markdown VS Code/Cursor extension (getAPI(1)): queries, edits, notes, events. Types only — no runtime code.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "HastyCapybara (W.Leester)",
|
|
7
|
+
"homepage": "https://github.com/W-Leester/tasks-for-markdown/blob/main/docs/api.en.md",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/W-Leester/tasks-for-markdown.git",
|
|
11
|
+
"directory": "packages/api"
|
|
12
|
+
},
|
|
13
|
+
"keywords": [
|
|
14
|
+
"vscode",
|
|
15
|
+
"markdown",
|
|
16
|
+
"tasks",
|
|
17
|
+
"obsidian",
|
|
18
|
+
"types"
|
|
19
|
+
],
|
|
20
|
+
"types": "./index.d.ts",
|
|
21
|
+
"files": [
|
|
22
|
+
"index.d.ts",
|
|
23
|
+
"README.md",
|
|
24
|
+
"LICENSE",
|
|
25
|
+
"NOTICE.md"
|
|
26
|
+
],
|
|
27
|
+
"publishConfig": {
|
|
28
|
+
"access": "public"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"typescript": "^5.6.0"
|
|
32
|
+
},
|
|
33
|
+
"scripts": {
|
|
34
|
+
"build": "tsc -p ../../tsconfig.api.json && node -e \"require('fs').copyFileSync('../../dist/api-types/api/types.d.ts','index.d.ts')\" && pnpm run prepack"
|
|
35
|
+
}
|
|
6
36
|
}
|