0.5.14 • Published 8 months ago

tw5-typed v0.5.14

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

TW5-Typed

TypeScript type definitions for TiddlyWiki5.

Doc Site - tiddly-gittly.github.io/TW5-Typed

Usage

First, install it as dev-dependency:

npm i -D tw5-typed

Add tw5-typed to your tsconfig.json's compilerOptions

{
  "compilerOptions": {
    "types": ["node", "tw5-typed"] /* Type declaration files to be included in compilation. */
  }
}

Then you will have global types like $tw automatically. You can import the rest of the types using import type statement:

import type { ISearchOptions, SourceIterator, IFilterOperatorParamOperator } from 'tiddlywiki';

Alias

Sometimes you may want to use a modified version of tw, you can re-export types like this in your src/type.d.ts:

declare module '@tiddlygit/tiddlywiki' {
  export * from 'tiddlywiki';
}

Development

Firstly, Install eslint using npm:

npm i

You can add new *.d.ts file to contain your types:

  1. use declare module 'tiddlywiki' { } to wrap all your types.
  2. don't forget to export all your types.
  3. to add type for global variable, add global { } inside that declare module 'tiddlywiki' { }, like global { var $tw: I$TW; }
  4. add type import like /// <reference path="ast.d.ts" /> in the tw.d.ts

Importing type from other files

  • add type import like /// <reference path="parser.d.ts" />
  • using normal import, like import { parse } from './parser'; will not work

Test in your node_modules

To rapid prototype the type, just right click a type to open .d.ts file in the node_modules, and try create new file there, and copy to this repo after a success.

Before publish

Make sure doc build and test are passed.

  1. Doc: pnpm run docs:generate && pnpm run docs:dev, see .github\workflows\deploy-docs-to-github-pages.yml
  2. Tests: pnpm run check, see .github\workflows\test.yml
0.5.14

8 months ago

0.5.13

8 months ago

0.5.12

10 months ago

0.5.11

1 year ago

0.5.10

1 year ago

0.5.8

1 year ago

0.5.9

1 year ago

0.5.7

1 year ago

0.5.6

1 year ago

0.5.5

1 year ago

0.5.4

1 year ago

0.5.3

1 year ago

0.5.2

1 year ago

0.5.0

1 year ago

0.5.1

1 year ago

0.4.9

1 year ago

0.4.8

1 year ago

0.4.7

1 year ago

0.4.6

1 year ago

0.4.5

1 year ago

0.4.4

1 year ago

0.4.1

1 year ago

0.4.3

1 year ago

0.4.2

1 year ago

0.4.0

2 years ago

0.3.0

2 years ago

0.3.6

2 years ago

0.3.5

2 years ago

0.3.8

2 years ago

0.3.7

2 years ago

0.3.2

2 years ago

0.3.1

2 years ago

0.3.4

2 years ago

0.3.3

2 years ago

0.3.9

2 years ago

0.3.11

2 years ago

0.3.10

2 years ago

0.2.27

2 years ago

0.2.26

2 years ago

0.2.25

2 years ago

0.2.24

2 years ago

0.2.23

2 years ago

0.2.22

2 years ago

0.2.21

2 years ago

0.2.20

2 years ago

0.2.19

2 years ago

0.2.18

2 years ago

0.2.17

2 years ago

0.2.16

2 years ago

0.2.15

2 years ago

0.2.14

3 years ago

0.2.13

3 years ago

0.2.12

3 years ago

0.2.11

3 years ago

0.2.10

3 years ago

0.2.9

3 years ago

0.2.7

3 years ago

0.2.6

3 years ago

0.2.8

3 years ago

0.1.10

3 years ago

0.1.11

3 years ago

0.1.12

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.2.3

3 years ago

0.2.2

3 years ago

0.2.5

3 years ago

0.2.4

3 years ago

0.1.8

3 years ago

0.1.7

3 years ago

0.1.9

3 years ago

0.1.6

3 years ago

0.1.5

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago

0.0.11

3 years ago

0.0.10

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago