1.3.24 • Published 19 days ago

zotero-types v1.3.24

Weekly downloads
-
License
MIT
Repository
github
Last release
19 days ago

Zotero Types

This package contains type definitions for Zotero (https://www.zotero.org/) plugin.

npm package: https://www.npmjs.com/package/zotero-types

Usage

  1. Run npm install --save-dev zotero-types.

  2. No need to import the type declaration in your TypeScript code. If your IDE does not recognize the definitions, add the path to typing file in the include of tsconfig.json:

    // tsconfig.json
    {
      "include": ["src", "typing", "node_modules/zotero-types"]
    }

Example:

// Example 1: get Zotero.Item by id
const item = Zotero.Items.get(1234);

// Example 2: use XUL.Element type with specific properties
const exportFiles = document.querySelector(
  "#menu_export_files"
) as XUL.Menuitem;
exportFiles.disabled = true;

// Example 3: use platform APIs (OS)
const filepath = "/path/to/file";
if (await OS.File.exists(filepath)) {
  let contentRaw = (await OS.File.read(filepath, {
    encoding: "utf-8",
  })) as string;
}

!NOTE

If you are using pnpm as the package manager for your project, you need to additionally do one of the following things:

  • Add public-hoist-pattern[]=*@types/bluebird* to .npmrc.
  • Add @types/bulebird to the devDependencies.

See also:

Contributing

This type definition only contains frequently used typings and is not complete. Please check the source code of Zotero here: https://github.com/zotero/zotero.

The d.ts files of Zotero are set accordingly to their corresponding file in the Zotero repository.

Planning to merge to https://github.com/DefinitelyTyped/DefinitelyTyped/

To release this to the npm package, use npm run release.

Disclaimer

Use this code under MIT License. No warranties are provided. Keep the laws of your locality in mind!

If you want to change the license, please contact me at wyzlshx@foxmail.com

Part of the code of this repo refers to other open-source projects within the allowed scope.

  • zotero-better-bibtex(d.ts)

Zotero Plugins Using This Package

1.3.24

19 days ago

1.3.23

23 days ago

1.3.22

25 days ago

1.3.21

28 days ago

1.3.20

1 month ago

1.3.19

2 months ago

1.3.17

3 months ago

1.3.18

3 months ago

1.3.15

3 months ago

1.3.14

3 months ago

1.3.13

4 months ago

1.3.12

4 months ago

1.3.11

4 months ago

1.3.10

5 months ago

1.3.9

5 months ago

1.3.8

5 months ago

1.3.7

5 months ago

1.3.6

5 months ago

1.3.5

6 months ago

1.3.4

6 months ago

1.3.3

6 months ago

1.3.2

6 months ago

1.2.0

9 months ago

1.1.0

9 months ago

1.0.16

11 months ago

1.2.8

7 months ago

1.2.7

7 months ago

1.2.6

7 months ago

1.2.4

8 months ago

1.2.3

8 months ago

1.3.1

7 months ago

1.2.2

8 months ago

1.3.0

7 months ago

1.2.1

9 months ago

1.0.2

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.15

12 months ago

1.0.14

12 months ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago

0.1.0

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.1.4

1 year ago

0.1.3

1 year ago

0.0.7

1 year ago

0.1.5

1 year ago

0.0.6

1 year ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago