tw5-typed 0.3.9 → 0.3.10
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/package.json
CHANGED
|
@@ -106,6 +106,12 @@ declare module 'tiddlywiki' {
|
|
|
106
106
|
data: string;
|
|
107
107
|
server: Server;
|
|
108
108
|
wiki: Wiki;
|
|
109
|
+
/**
|
|
110
|
+
* With `exports.path = /^\/recipes\/default\/tiddlers\/(.+)$/;` you can use:
|
|
111
|
+
*
|
|
112
|
+
* `title = $tw.utils.decodeURIComponentSafe(state.params[0])`
|
|
113
|
+
*/
|
|
114
|
+
params: string[];
|
|
109
115
|
}
|
|
110
116
|
/**
|
|
111
117
|
* @link https://talk.tiddlywiki.org/t/what-is-the-state-in-server-route-handler/2877
|
|
File without changes
|
package/src/tiddler/index.d.ts
CHANGED
|
@@ -38,7 +38,7 @@ declare module 'tiddlywiki' {
|
|
|
38
38
|
Get all the fields as a hashmap of strings. Options:
|
|
39
39
|
exclude: an array of field names to exclude
|
|
40
40
|
*/
|
|
41
|
-
getFieldStrings(
|
|
41
|
+
getFieldStrings(options?: { exclude?: string[] }): Record<string, string>;
|
|
42
42
|
getFieldDay(field: string): string;
|
|
43
43
|
/**
|
|
44
44
|
Get the value of a field as a list
|
package/src/wiki/index.d.ts
CHANGED
|
@@ -194,7 +194,7 @@ declare module 'tiddlywiki' {
|
|
|
194
194
|
parseTiddler(title: string, options?: IParseOptions): WikiParser;
|
|
195
195
|
/**
|
|
196
196
|
Parse a block of text of a specified MIME type
|
|
197
|
-
@param {string} type: content type of text to be parsed
|
|
197
|
+
@param {string} type: MIME content type of text to be parsed
|
|
198
198
|
@param {string} text: text
|
|
199
199
|
@param {object}options: see below
|
|
200
200
|
|
|
@@ -203,6 +203,22 @@ declare module 'tiddlywiki' {
|
|
|
203
203
|
- _canonical_uri: optional string of the canonical URI of this content
|
|
204
204
|
*/
|
|
205
205
|
parseText(type: string, text: string, options?: IParseOptions): WikiParser;
|
|
206
|
+
/**
|
|
207
|
+
* Extracts tiddlers from a typed block of text, specifying default field values
|
|
208
|
+
* @param {string} type: MIME content type of text to be parsed
|
|
209
|
+
* @param {string} text: text
|
|
210
|
+
* @param {object} srcFields: default field values
|
|
211
|
+
* @param {object} options: see below
|
|
212
|
+
*
|
|
213
|
+
* Options include:
|
|
214
|
+
* - deserializer: string, key of `$tw.Wiki.tiddlerDeserializerModules`
|
|
215
|
+
*/
|
|
216
|
+
deserializeTiddlers(
|
|
217
|
+
type: string,
|
|
218
|
+
text: string,
|
|
219
|
+
srcFields?: ITiddlerFieldsParam,
|
|
220
|
+
options?: IParseOptions,
|
|
221
|
+
): ITiddlerFieldsParam[];
|
|
206
222
|
/**
|
|
207
223
|
Parse text from a tiddler and render it into another format
|
|
208
224
|
outputType: content type for the output
|
|
@@ -314,17 +330,11 @@ declare module 'tiddlywiki' {
|
|
|
314
330
|
handler: (event: unknown) => void | Promise<void>,
|
|
315
331
|
): void;
|
|
316
332
|
addEventListener(
|
|
317
|
-
type:
|
|
333
|
+
type: 'change',
|
|
318
334
|
handler: (change: IChangedTiddlers) => void | Promise<void>,
|
|
319
335
|
): void;
|
|
320
336
|
|
|
321
|
-
dispatchEvent(
|
|
322
|
-
|
|
323
|
-
dataOrEvent: unknown,
|
|
324
|
-
): void;
|
|
325
|
-
dispatchEvent(
|
|
326
|
-
type: "change",
|
|
327
|
-
change: IChangedTiddlers,
|
|
328
|
-
): void;
|
|
337
|
+
dispatchEvent(type: string, dataOrEvent: unknown): void;
|
|
338
|
+
dispatchEvent(type: 'change', change: IChangedTiddlers): void;
|
|
329
339
|
}
|
|
330
340
|
}
|