diff --git a/.dprint.jsonc b/.dprint.jsonc
index 28ff356cfaad10..c33d0ed2898e28 100644
--- a/.dprint.jsonc
+++ b/.dprint.jsonc
@@ -38,21 +38,16 @@
"./types/**/*.md"
],
- "prettier": {
- "associations": [
- "**/*.{yaml,yml}"
- ],
- "yml.tabWidth": 2,
- "yaml.tabWidth": 2,
- "yml.singleQuote": true,
- "yaml.singleQuote": true
+ "yaml": {
+ "indentWidth": 2,
+ "quotes": "preferSingle"
},
// NOTE: if extending this list, also update settings.template.json.
"plugins": [
- "https://plugins.dprint.dev/typescript-0.91.4.wasm",
- "https://plugins.dprint.dev/json-0.19.3.wasm",
- "https://plugins.dprint.dev/markdown-0.17.1.wasm",
- "https://plugins.dprint.dev/prettier-0.40.0.json@68c668863ec834d4be0f6f5ccaab415df75336a992aceb7eeeb14fdf096a9e9c"
+ "https://plugins.dprint.dev/typescript-0.93.3.wasm",
+ "https://plugins.dprint.dev/json-0.19.4.wasm",
+ "https://plugins.dprint.dev/markdown-0.17.8.wasm",
+ "https://plugins.dprint.dev/g-plane/pretty_yaml-v0.5.0.wasm"
],
"indentWidth": 4,
"lineWidth": 120,
diff --git a/README.md b/README.md
index e99fc246964fa1..994458e1d12dbb 100644
--- a/README.md
+++ b/README.md
@@ -135,11 +135,15 @@ then follow the instructions to [edit an existing package](#edit-an-existing-pac
Once you've tested your package, you can share it on Definitely Typed.
-First, [fork](https://guides.github.com/activities/forking/) this repository, [clone](#partial-clone) it,
-install [node](https://nodejs.org/) and run `pnpm install`. Note that `pnpm install` will install the _entire_
-repository, including packages you may not be editing. If you'd like to install only a subset,
-you can run `pnpm install -w --filter "{./types/foo}..."` to install `@types/foo` and all of
-its dependencies. If you need to run tests for packages that _depend_ on `@types/foo`, you can run `pnpm install -w --filter "...{./types/foo}..."` to pull in all related packages for testing.
+1. [Fork](https://guides.github.com/activities/forking/) this repository.
+1. Clone it.
+ - The Definitely Typed repo is large; you may want to consider using a ["blobless clone"](https://github.blog/open-source/git/get-up-to-speed-with-partial-clone-and-shallow-clone/#user-content-blobless-clones) to save time and space by passing `--filter=blob:none` when running `git clone`.
+1. Install [node](https://nodejs.org/).
+1. Run `pnpm install`.
+ - `pnpm install` will install the _entire_
+ repository, including packages you may not be editing. If you'd like to install only a subset,
+ you can run `pnpm install -w --filter "{./types/foo}..."` to install `@types/foo` and all of
+ its dependencies. If you need to run tests for packages that _depend_ on `@types/foo`, you can run `pnpm install -w --filter "...{./types/foo}..."` to pull in all related packages for testing.
> [!NOTE]
> If you are using Windows, you may find that `git clean` does not remove the `node_modules` directory or hangs when doing so. If you need to remove `node_modules`, you can run `pnpm clean-node-modules` to reset the repo.
@@ -148,24 +152,6 @@ We use a bot to let a large number of pull requests to DefinitelyTyped be handle
-#### Partial clone
-
-
-You can clone the entire repository as per usual, but it's large and includes a massive directory of type packages.
-
-You can clone the entire repository [as per usual](https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/cloning-a-repository), but it's large and includes a massive directory of type packages. This will take some time to clone and may be unnecessarily unwieldy.
-
-For a more manageable clone that includes _only_ the type packages relevant to you, you can use git's [`sparse-checkout`](https://git-scm.com/docs/git-sparse-checkout) and [`--filter`](https://git-scm.com/docs/git-rev-list#Documentation/git-rev-list.txt---filterltfilter-specgt) features. This will reduce clone time and improve git performance.
-
-> :warning: This requires minimum [git version 2.27.0](https://git-scm.com/downloads), which is likely newer than the default on most machines. More complicated procedures are available in older versions, but not covered by this guide.
-
-1. `git clone --sparse --filter=blob:none `
- - `--sparse` initializes the sparse-checkout file so the working directory starts with only the files in the root of the repository.
- - `--filter=blob:none` will including all commit history but exclude files, fetching them only as needed.
-2. `git sparse-checkout add types/ types/ ...`
-
-
-
#### Edit an existing package
- Make changes. Remember to [edit tests](#my-package-teststs).
@@ -605,7 +591,7 @@ Then they are wrong and we've not noticed yet. You can help by submitting a pull
Yes, using [dprint](https://dprint.dev).
We recommend using a [dprint extension for your editor](https://dprint.dev/install/#editor-extensions).
-Alternatively, you can enable a git hook which will format your code automatically. Run `pnpm run setup-hooks`. Then, when you commit, `dprint fmt` command will be executed on changed files. If you take advantage of [partial clone](#partial-clone), make sure to call `git sparse-checkout add .husky` to check out the git hooks before running the `setup-hooks` script.
+Alternatively, you can enable a git hook which will format your code automatically. Run `pnpm run setup-hooks`. Then, when you commit, `dprint fmt` command will be executed on changed files.
Pull requests do not require correct formatting to be merged.
Any unformatted code will be automatically reformatted after being merged.
diff --git a/notNeededPackages.json b/notNeededPackages.json
index c0d618256bca85..5358afc0df0bf8 100644
--- a/notNeededPackages.json
+++ b/notNeededPackages.json
@@ -516,6 +516,14 @@
"libraryName": "burns",
"asOfVersion": "2.1.0"
},
+ "cache-manager": {
+ "libraryName": "cache-manager",
+ "asOfVersion": "5.0.0"
+ },
+ "cache-manager-redis-store": {
+ "libraryName": "cache-manager-redis-store",
+ "asOfVersion": "3.0.0"
+ },
"cacheable-request": {
"libraryName": "cacheable-request",
"asOfVersion": "8.3.1"
@@ -1028,6 +1036,10 @@
"libraryName": "contentstack",
"asOfVersion": "3.11.0"
},
+ "conventional-changelog-preset-loader": {
+ "libraryName": "conventional-changelog-preset-loader",
+ "asOfVersion": "5.0.0"
+ },
"conventional-recommended-bump": {
"libraryName": "conventional-recommended-bump",
"asOfVersion": "10.0.0"
@@ -3665,6 +3677,10 @@
"libraryName": "meow",
"asOfVersion": "6.0.0"
},
+ "merge-refs": {
+ "libraryName": "merge-refs",
+ "asOfVersion": "1.1.0"
+ },
"mermaid": {
"libraryName": "mermaid",
"asOfVersion": "9.2.0"
@@ -4157,6 +4173,10 @@
"libraryName": "openid-client",
"asOfVersion": "3.7.0"
},
+ "openpgp": {
+ "libraryName": "openpgp",
+ "asOfVersion": "5.0.0"
+ },
"opn": {
"libraryName": "opn",
"asOfVersion": "5.5.0"
diff --git a/package.json b/package.json
index d45d79515dbd58..1615326f103a07 100644
--- a/package.json
+++ b/package.json
@@ -38,7 +38,7 @@
"@definitelytyped/typescript-versions": "latest",
"@definitelytyped/utils": "latest",
"danger": "^11.2.3",
- "dprint": "^0.47.2",
+ "dprint": "^0.49.0",
"eslint-plugin-jsdoc": "^44.2.7",
"husky": "^8.0.3",
"lint-staged": "^15.2.0",
diff --git a/types/cache-manager-fs-hash/package.json b/types/cache-manager-fs-hash/package.json
index d76fcc2b8c48b7..35d99a52117fb3 100644
--- a/types/cache-manager-fs-hash/package.json
+++ b/types/cache-manager-fs-hash/package.json
@@ -6,7 +6,7 @@
"https://github.com/rolandstarke/node-cache-manager-fs-hash#readme"
],
"dependencies": {
- "@types/cache-manager": "*"
+ "@types/cache-manager": "<4"
},
"devDependencies": {
"@types/cache-manager-fs-hash": "workspace:."
diff --git a/types/cache-manager-ioredis/package.json b/types/cache-manager-ioredis/package.json
index c88d905ada48d6..f2b98c8e05da5e 100644
--- a/types/cache-manager-ioredis/package.json
+++ b/types/cache-manager-ioredis/package.json
@@ -6,7 +6,7 @@
"https://github.com/dabroek/node-cache-manager-ioredis"
],
"dependencies": {
- "@types/cache-manager": "*",
+ "@types/cache-manager": "<3",
"@types/ioredis": "^4.28.10"
},
"devDependencies": {
diff --git a/types/cache-manager-memcached-store/package.json b/types/cache-manager-memcached-store/package.json
index f7aabb99bec919..2e85f5777e3584 100644
--- a/types/cache-manager-memcached-store/package.json
+++ b/types/cache-manager-memcached-store/package.json
@@ -6,7 +6,7 @@
"https://github.com/theogravity/node-cache-manager-memcached-store"
],
"dependencies": {
- "@types/cache-manager": "*"
+ "@types/cache-manager": "<4"
},
"devDependencies": {
"@types/cache-manager-memcached-store": "workspace:."
diff --git a/types/cache-manager-redis-store/.npmignore b/types/cache-manager-redis-store/.npmignore
deleted file mode 100644
index 93e307400a5456..00000000000000
--- a/types/cache-manager-redis-store/.npmignore
+++ /dev/null
@@ -1,5 +0,0 @@
-*
-!**/*.d.ts
-!**/*.d.cts
-!**/*.d.mts
-!**/*.d.*.ts
diff --git a/types/cache-manager-redis-store/cache-manager-redis-store-tests.ts b/types/cache-manager-redis-store/cache-manager-redis-store-tests.ts
deleted file mode 100644
index b8472471a156e3..00000000000000
--- a/types/cache-manager-redis-store/cache-manager-redis-store-tests.ts
+++ /dev/null
@@ -1,38 +0,0 @@
-import * as cacheManager from "cache-manager";
-import * as redisStore from "cache-manager-redis-store";
-
-const redisCache = cacheManager.caching({
- store: redisStore,
- host: "localhost", // default value
- port: 6379, // default value
- password: "XXXXX",
- db: 0,
- ttl: 600,
-});
-
-const clusterCache = cacheManager.caching({
- store: redisStore,
- clusterConfig: {
- nodes: [
- {
- port: 6380,
- host: "127.0.0.1",
- },
- {
- port: 6381,
- host: "127.0.0.1",
- },
- ],
- options: {
- maxRedirections: 16,
- },
- },
- ttl: 600,
-});
-
-redisCache.store.getClient();
-clusterCache.store.getClient();
-
-const memoryCache = cacheManager.caching({ store: "memory", max: 100, ttl: 60 });
-
-cacheManager.multiCaching([redisCache, memoryCache]);
diff --git a/types/cache-manager-redis-store/index.d.ts b/types/cache-manager-redis-store/index.d.ts
deleted file mode 100644
index e31a3423793769..00000000000000
--- a/types/cache-manager-redis-store/index.d.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-import { Cache, CacheOptions, Store, StoreConfig } from "cache-manager";
-import * as Redis from "redis";
-
-declare const methods: CacheManagerRedisStore.RedisStoreConstructor;
-export = methods;
-export {};
-
-declare module "cache-manager" {
- function caching(IConfig: StoreConfig & CacheOptions): CacheManagerRedisStore.RedisCache;
-}
-
-declare namespace CacheManagerRedisStore {
- interface RedisCache extends Cache {
- store: RedisStore;
- }
-
- interface RedisStore extends Store {
- name: "redis";
- getClient: () => Redis.RedisClient;
- isCacheableValue: (value: any) => boolean;
- }
-
- interface RedisStoreConstructor {
- create: (options?: Redis.ClientOpts) => RedisStore;
- }
-}
diff --git a/types/cache-manager-redis-store/package.json b/types/cache-manager-redis-store/package.json
deleted file mode 100644
index 24d54b61702ecf..00000000000000
--- a/types/cache-manager-redis-store/package.json
+++ /dev/null
@@ -1,21 +0,0 @@
-{
- "private": true,
- "name": "@types/cache-manager-redis-store",
- "version": "2.0.9999",
- "projects": [
- "https://github.com/dabroek/node-cache-manager-redis-store"
- ],
- "dependencies": {
- "@types/cache-manager": "*",
- "@types/redis": "^2.8.0"
- },
- "devDependencies": {
- "@types/cache-manager-redis-store": "workspace:."
- },
- "owners": [
- {
- "name": "Eduardo Cancino",
- "githubUsername": "ecancinoz-chwy"
- }
- ]
-}
diff --git a/types/cache-manager-redis-store/tsconfig.json b/types/cache-manager-redis-store/tsconfig.json
deleted file mode 100644
index 8b1f2312cb5a3d..00000000000000
--- a/types/cache-manager-redis-store/tsconfig.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "compilerOptions": {
- "module": "node16",
- "lib": [
- "es6"
- ],
- "noImplicitAny": true,
- "noImplicitThis": true,
- "strictFunctionTypes": true,
- "strictNullChecks": true,
- "types": [],
- "noEmit": true,
- "forceConsistentCasingInFileNames": true
- },
- "files": [
- "index.d.ts",
- "cache-manager-redis-store-tests.ts"
- ]
-}
diff --git a/types/cache-manager/.eslintrc.json b/types/cache-manager/.eslintrc.json
deleted file mode 100644
index 42df4822d6e0a8..00000000000000
--- a/types/cache-manager/.eslintrc.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "rules": {
- "@definitelytyped/no-unnecessary-generics": "off",
- "@typescript-eslint/no-unsafe-function-type": "off",
- "@typescript-eslint/no-wrapper-object-types": "off"
- }
-}
diff --git a/types/cache-manager/.npmignore b/types/cache-manager/.npmignore
deleted file mode 100644
index 93e307400a5456..00000000000000
--- a/types/cache-manager/.npmignore
+++ /dev/null
@@ -1,5 +0,0 @@
-*
-!**/*.d.ts
-!**/*.d.cts
-!**/*.d.mts
-!**/*.d.*.ts
diff --git a/types/cache-manager/cache-manager-tests.ts b/types/cache-manager/cache-manager-tests.ts
deleted file mode 100644
index 9bf698e950831e..00000000000000
--- a/types/cache-manager/cache-manager-tests.ts
+++ /dev/null
@@ -1,122 +0,0 @@
-import * as cacheManager from "cache-manager";
-
-// Args should all be optional
-const memoryCacheWithNoArgs: cacheManager.Cache = cacheManager.caching({
- store: "memory",
-});
-
-const memoryCache: cacheManager.Cache = cacheManager.caching({
- store: "memory",
- max: 20,
- maxSize: 100,
- sizeCalculation: (value: any, key: any) => JSON.stringify(value).length,
- ttl: 10, /*seconds*/
-});
-const ttl = 5;
-
-memoryCache.set("foo", "bar", { ttl: ttl }, err => {
- if (err) {
- throw err;
- }
-
- memoryCache.get("foo", (err, result) => {
- // console.log(result);
-
- memoryCache.del("foo", err => {});
- });
-});
-
-function getUser(id: number, cb: Function) {
- cb(null, { id: id, name: "Bob" });
-}
-
-const userId = 123;
-const key = "user_" + userId;
-const key2 = "user_" + userId + "4";
-
-// Note: ttl is optional in wrap()
-memoryCache.wrap<{ id: number; name: string }>(
- key,
- (cb: any) => {
- getUser(userId, cb);
- },
- { ttl: ttl },
- (err: any, user: { id: number; name: string }) => {
- // console.log(user);
-
- // Second time fetches user from memoryCache
- memoryCache.wrap<{ id: number; name: string }>(
- key,
- key2,
- (cb: any) => {
- getUser(userId, cb);
- },
- (err: any, user: { id: number; name: string }) => {
- // console.log(user);
- },
- );
- },
-);
-
-if (memoryCache.store.keys) {
- memoryCache.store.keys().then(result => {
- // console.log(result);
- });
-}
-
-memoryCache.reset().then(() => {
- // console.log('reset with promise');
-});
-memoryCache.reset(() => {
- // console.log('reset with callback');
-});
-
-async function promiseMemoryCache(cache: cacheManager.Cache) {
- const KEY = "Key";
- const VALUE = "string";
-
- const numberWrap: number = await cache.wrap(KEY, () => 1);
- const numberWrapAsync: number = await cache.wrap(KEY, async () => 1);
-
- const stringWrap: string = await cache.wrap(KEY, () => VALUE);
- const stringWrapAsync: string = await cache.wrap(KEY, async () => VALUE);
-
- const stringWrapWithCacheConfig: string = await cache.wrap(KEY, () => VALUE, { ttl: 10 });
- const stringWrapWithCacheConfigAsync: string = await cache.wrap(KEY, async () => VALUE, { ttl: 10 });
-
- const setWithoutOptional = await cache.set(KEY, VALUE);
- const setWitOptional = await cache.set(KEY, VALUE, { ttl: 10 });
-
- const stringTypeSet: string = await cache.set(KEY, VALUE);
- const stringTypeGet: string | undefined = await cache.get(KEY);
-
- const numberTypeSet: number = await cache.set(KEY, 1);
- const numberTypeGet: number | undefined = await cache.get(KEY);
-
- interface Custom {
- test: string;
- }
-
- const CustomValue: Custom = { test: VALUE };
-
- const customTypeSet: Custom = await cache.set(KEY, CustomValue);
- const customTypeGet: Custom | undefined = await cache.get(KEY);
-}
-
-const multiCache = cacheManager.multiCaching([memoryCache]);
-
-multiCache.set("foo", "bar", { ttl: ttl }, err => {
- if (err) {
- throw err;
- }
-
- multiCache.get("foo", (err, result) => {
- // console.log(result);
-
- multiCache.del("foo", err => {});
- });
-});
-
-multiCache.reset(() => {
- // console.log('multiCache reset');
-});
diff --git a/types/cache-manager/index.d.ts b/types/cache-manager/index.d.ts
deleted file mode 100644
index ccfc24dad3cd7e..00000000000000
--- a/types/cache-manager/index.d.ts
+++ /dev/null
@@ -1,112 +0,0 @@
-export interface CachingConfig {
- ttl?: number | TtlFunction;
-}
-
-export interface TtlFunction {
- (result: any): number;
-}
-
-export interface Store {
- // These functions will just be bound to the Cache object if they exist so args can be anything
- get(...args: any[]): Promise;
- set(...args: any[]): Promise;
-
- mget?(...args: any[]): Promise;
- mset?(...args: any[]): Promise;
- del?(...args: any[]): Promise;
- setex?(...args: any[]): Promise;
- reset?(...args: any[]): Promise;
- keys?(...args: any[]): Promise;
- ttl?(...args: any[]): Promise;
-}
-
-export interface StoreConfig extends CachingConfig {
- store:
- | "memory"
- | "none"
- | Store
- | {
- create(...args: any[]): Store;
- };
- max?: number;
- maxSize?: number;
- sizeCalculation?: (value: any, key: any) => number;
-
- /**
- * You may pass in any other arguments these will be passed on to the `create` method of your store,
- * otherwise they will be ignored.
- */
- [key: string]: any;
-}
-
-export interface CacheOptions {
- /**
- * Promise library to replace global.Promise
- */
- promiseDependency?: any;
- isCacheableValue?(value: any): boolean;
-}
-
-export type CallbackFunc = (error: any, result: T) => void;
-export type WrapArgsType =
- | string
- | ((callback: CallbackFunc) => void)
- | CachingConfig
- | CallbackFunc
- | (() => PromiseLike | T);
-
-export interface Cache {
- set(key: string, value: T, options?: CachingConfig): Promise;
- set(key: string, value: T, ttl: number): Promise;
- set(key: string, value: T, options: CachingConfig, callback: (error: any) => void): void;
- set(key: string, value: T, ttl: number, callback: (error: any) => void): void;
-
- // 2021-01-14: This could be updated with TypeScript 4.2 https://devblogs.microsoft.com/typescript/announcing-typescript-4-2-beta/#leading-middle-rest-elements-in-tuple-types
- // Because the library accepts multiple keys as arguments but not as an array and rather as individual parameters
- // of the function, the type definition had to be changed to this rather than specific ones
- // actual definitions would looks like this (impossible in typescript):
- // wrap(...keys: string[], work: (callback: (error: any, result: T) => void) => void, options: CachingConfig, callback: (error: any, result: T) => void): void
- // wrap(...keys: string[], work: (callback: (error: any, result: T) => void) => void, callback: (error: any, result: T) => void): void
- // wrap(...keys: string[], work: (callback: (error: any, result: T) => void) => void, options: CachingConfig): void
- // wrap(...keys: string[], work: (callback: (error: any, result: T) => void) => void): Promise;
- wrap(...args: Array>): Promise;
-
- get(key: string, callback: (error: any, result: T | undefined) => void): void;
- get(key: string): Promise;
-
- del(key: string, callback: (error: any) => void): void;
- del(key: string): Promise;
-
- reset(): Promise;
- reset(cb: () => void): void;
-
- store: Store;
-}
-
-export interface MultiCache {
- set(key: string, value: T, options?: CachingConfig): Promise;
- set(key: string, value: T, ttl: number): Promise;
- set(key: string, value: T, options: CachingConfig, callback: (error: any) => void): void;
- set(key: string, value: T, ttl: number, callback: (error: any) => void): void;
-
- // 2021-01-14: This could be updated with TypeScript 4.2 https://devblogs.microsoft.com/typescript/announcing-typescript-4-2-beta/#leading-middle-rest-elements-in-tuple-types
- // Because the library accepts multiple keys as arguments but not as an array and rather as individual parameters
- // of the function, the type definition had to be changed to this rather than specific ones
- // actual definitions would looks like this (impossible in typescript):
- // wrap(...keys: string[], work: (callback: (error: any, result: T) => void) => void, options: CachingConfig, callback: (error: any, result: T) => void): void
- // wrap(...keys: string[], work: (callback: (error: any, result: T) => void) => void, callback: (error: any, result: T) => void): void
- // wrap(...keys: string[], work: (callback: (error: any, result: T) => void) => void, options: CachingConfig): void
- // wrap(...keys: string[], work: (callback: (error: any, result: T) => void) => void): Promise;
- wrap(...args: Array>): Promise;
-
- get(key: string, callback: (error: any, result: T | undefined) => void): void;
- get(key: string): Promise;
-
- del(key: string, callback: (error: any) => void): void;
- del(key: string): Promise;
-
- reset(cb: () => void): void;
-}
-
-export function caching(IConfig: StoreConfig & CacheOptions): Cache;
-export function multiCaching(Caches: Cache[], options?: CacheOptions): MultiCache;
diff --git a/types/cache-manager/package.json b/types/cache-manager/package.json
deleted file mode 100644
index 1e6999b464534b..00000000000000
--- a/types/cache-manager/package.json
+++ /dev/null
@@ -1,25 +0,0 @@
-{
- "private": true,
- "name": "@types/cache-manager",
- "version": "4.0.9999",
- "projects": [
- "https://github.com/BryanDonovan/node-cache-manager"
- ],
- "devDependencies": {
- "@types/cache-manager": "workspace:."
- },
- "owners": [
- {
- "name": "Dominik Einkemmer",
- "githubUsername": "dominikeinkemmer"
- },
- {
- "name": "Eduard Marbach",
- "githubUsername": "BlackDark"
- },
- {
- "name": "Bryan Donovan",
- "githubUsername": "BryanDonovan"
- }
- ]
-}
diff --git a/types/cache-manager/tsconfig.json b/types/cache-manager/tsconfig.json
deleted file mode 100644
index 717b2151284e58..00000000000000
--- a/types/cache-manager/tsconfig.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "compilerOptions": {
- "module": "node16",
- "lib": [
- "es6"
- ],
- "noImplicitAny": true,
- "noImplicitThis": true,
- "strictNullChecks": true,
- "strictFunctionTypes": true,
- "types": [],
- "noEmit": true,
- "forceConsistentCasingInFileNames": true
- },
- "files": [
- "index.d.ts",
- "cache-manager-tests.ts"
- ]
-}
diff --git a/types/conventional-changelog-core/conventional-changelog-core-tests.ts b/types/conventional-changelog-core/conventional-changelog-core-tests.ts
index cf6ca158769be2..ebc5341db1dc46 100644
--- a/types/conventional-changelog-core/conventional-changelog-core-tests.ts
+++ b/types/conventional-changelog-core/conventional-changelog-core-tests.ts
@@ -2,7 +2,6 @@
"use strict";
import conventionalChangelogCore from "conventional-changelog-core";
-import gitRawCommits from "git-raw-commits";
namespace Module {
declare const context: conventionalChangelogCore.Context;
@@ -10,7 +9,6 @@ namespace Module {
declare const options: conventionalChangelogCore.Options;
declare const parserOpts: conventionalChangelogCore.ParserOptions;
declare const writerOpts: conventionalChangelogCore.WriterOptions;
- declare const execOpts: gitRawCommits.ExecOptions;
// $ExpectType Readable
conventionalChangelogCore();
// $ExpectType Readable
@@ -23,6 +21,4 @@ namespace Module {
conventionalChangelogCore(options, context, gitRawCommitsOpts, parserOpts);
// $ExpectType Readable
conventionalChangelogCore(options, context, gitRawCommitsOpts, parserOpts, writerOpts);
- // $ExpectType Readable
- conventionalChangelogCore(options, context, gitRawCommitsOpts, parserOpts, writerOpts, execOpts);
}
diff --git a/types/conventional-changelog-core/index.d.ts b/types/conventional-changelog-core/index.d.ts
index 1127bc38245af1..565e117fd45886 100644
--- a/types/conventional-changelog-core/index.d.ts
+++ b/types/conventional-changelog-core/index.d.ts
@@ -4,7 +4,7 @@ import * as Stream from "stream";
import { Context as BaseContext, Options as BaseWriterOptions } from "conventional-changelog-writer";
import { Commit, Options as BaseParserOptions } from "conventional-commits-parser";
-import { ExecOptions as GitRawExecOptions, GitOptions as BaseGitRawCommitsOptions } from "git-raw-commits";
+import { GitOptions as BaseGitRawCommitsOptions } from "git-raw-commits";
import { Package } from "normalize-package-data";
@@ -23,7 +23,6 @@ declare function conventionalChangelogCore,
- execOpts?: GitRawExecOptions,
): Stream.Readable;
declare namespace conventionalChangelogCore {
@@ -481,4 +480,4 @@ type ParserOptions = conventionalChangelogCore.ParserOptions;
type WriterOptions =
conventionalChangelogCore.WriterOptions;
-export = conventionalChangelogCore;
+export default conventionalChangelogCore;
diff --git a/types/conventional-changelog-core/package.json b/types/conventional-changelog-core/package.json
index ba23704510d203..a0dbe583b0a399 100644
--- a/types/conventional-changelog-core/package.json
+++ b/types/conventional-changelog-core/package.json
@@ -1,7 +1,8 @@
{
"private": true,
"name": "@types/conventional-changelog-core",
- "version": "4.2.9999",
+ "type": "module",
+ "version": "8.0.9999",
"projects": [
"https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-core#readme"
],
diff --git a/types/conventional-changelog-preset-loader/.npmignore b/types/conventional-changelog-preset-loader/.npmignore
deleted file mode 100644
index 93e307400a5456..00000000000000
--- a/types/conventional-changelog-preset-loader/.npmignore
+++ /dev/null
@@ -1,5 +0,0 @@
-*
-!**/*.d.ts
-!**/*.d.cts
-!**/*.d.mts
-!**/*.d.*.ts
diff --git a/types/conventional-changelog-preset-loader/conventional-changelog-preset-loader-tests.ts b/types/conventional-changelog-preset-loader/conventional-changelog-preset-loader-tests.ts
deleted file mode 100644
index 63cda15562d149..00000000000000
--- a/types/conventional-changelog-preset-loader/conventional-changelog-preset-loader-tests.ts
+++ /dev/null
@@ -1,34 +0,0 @@
-/* tslint:disable:no-mergeable-namespace no-namespace */
-
-import conventionalChangelogPresetLoader = require("conventional-changelog-preset-loader");
-
-namespace Module {
- declare const path: string;
- declare const config: conventionalChangelogPresetLoader.Config;
-
- // $ExpectType Config
- conventionalChangelogPresetLoader(path);
- // $ExpectType Config
- conventionalChangelogPresetLoader(config);
-
- // @ts-expect-error
- conventionalChangelogPresetLoader();
-}
-
-namespace Module.presetLoader {
- declare const require: conventionalChangelogPresetLoader.presetLoader.RequireMethod;
-
- // $ExpectType typeof conventionalChangelogPresetLoader
- conventionalChangelogPresetLoader.presetLoader(require);
-
- // @ts-expect-error
- conventionalChangelogPresetLoader.presetLoader();
-}
-
-namespace Module.Config {
- declare const config: conventionalChangelogPresetLoader.Config;
-
- // $ExpectType Config
- config;
- config.name; // $ExpectType string
-}
diff --git a/types/conventional-changelog-preset-loader/index.d.ts b/types/conventional-changelog-preset-loader/index.d.ts
deleted file mode 100644
index 2f97353c5eeaef..00000000000000
--- a/types/conventional-changelog-preset-loader/index.d.ts
+++ /dev/null
@@ -1,50 +0,0 @@
-import { Options as CoreOptions } from "conventional-changelog-core";
-import { Context as WriterContext } from "conventional-changelog-writer";
-import { Commit } from "conventional-commits-parser";
-
-/**
- * The string that is passed to the preset loader is manipulated by prepending
- * `conventional-changelog` to the name.
- *
- * For example:
- *
- * * `angular` => `conventional-changelog-angular`
- * * `angular/preset/path` => `conventional-changelog-angular/preset/path`
- * * `@scope/angular` => `@scope/conventional-changelog-angular`
- * * `@scope/angular/preset/path` => `@scope/conventional-changelog-angular/preset/path`
- *
- * Will return whatever is exported by the preset package. That may be a
- * configuration object, a function, or a promise.
- *
- * @param path
- */
-declare function conventionalChangelogPresetLoader(path: string | Config): CoreOptions.Config;
-
-declare namespace conventionalChangelogPresetLoader {
- function presetLoader(requireMethod: presetLoader.RequireMethod): typeof conventionalChangelogPresetLoader;
-
- namespace presetLoader {
- type RequireMethod = (id: string) => any;
- }
-
- type Builder = (config: CoreOptions.Config.Object & Config) => CoreOptions.Config;
-
- interface Config {
- /**
- * The string that is passed to the preset loader is manipulated by prepending
- * `conventional-changelog` to the name.
- *
- * For example:
- *
- * * `angular` => `conventional-changelog-angular`
- * * `angular/preset/path` => `conventional-changelog-angular/preset/path`
- * * `@scope/angular` => `@scope/conventional-changelog-angular`
- * * `@scope/angular/preset/path` => `@scope/conventional-changelog-angular/preset/path`
- */
- name: string;
- }
-}
-
-type Config = conventionalChangelogPresetLoader.Config;
-
-export = conventionalChangelogPresetLoader;
diff --git a/types/conventional-changelog-preset-loader/package.json b/types/conventional-changelog-preset-loader/package.json
deleted file mode 100644
index 07b2ba7144a903..00000000000000
--- a/types/conventional-changelog-preset-loader/package.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "private": true,
- "name": "@types/conventional-changelog-preset-loader",
- "version": "2.3.9999",
- "projects": [
- "https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-preset-loader#readme"
- ],
- "dependencies": {
- "@types/conventional-changelog-core": "*",
- "@types/conventional-changelog-writer": "*",
- "@types/conventional-commits-parser": "*"
- },
- "devDependencies": {
- "@types/conventional-changelog-preset-loader": "workspace:."
- },
- "owners": [
- {
- "name": "Jason Kwok",
- "githubUsername": "JasonHK"
- }
- ]
-}
diff --git a/types/conventional-changelog-preset-loader/tsconfig.json b/types/conventional-changelog-preset-loader/tsconfig.json
deleted file mode 100644
index c0f15f71cfc077..00000000000000
--- a/types/conventional-changelog-preset-loader/tsconfig.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "compilerOptions": {
- "module": "node16",
- "lib": [
- "es6"
- ],
- "noImplicitAny": true,
- "noImplicitThis": true,
- "strictFunctionTypes": true,
- "strictNullChecks": true,
- "types": [],
- "noEmit": true,
- "forceConsistentCasingInFileNames": true
- },
- "files": [
- "index.d.ts",
- "conventional-changelog-preset-loader-tests.ts"
- ]
-}
diff --git a/types/conventional-changelog/index.d.ts b/types/conventional-changelog/index.d.ts
index f283b9ca73f9f3..aa279682da6f07 100644
--- a/types/conventional-changelog/index.d.ts
+++ b/types/conventional-changelog/index.d.ts
@@ -1,16 +1,9 @@
///
-import * as Stream from "stream";
-
-import {
- Context,
- GitRawCommitsOptions,
- Options as BaseOptions,
- ParserOptions,
- WriterOptions,
-} from "conventional-changelog-core";
+import conventionalChangelogCore from "conventional-changelog-core";
import { Context as WriterContext } from "conventional-changelog-writer";
import { Commit } from "conventional-commits-parser";
+import * as Stream from "stream";
/**
* Returns a readable stream.
@@ -21,12 +14,15 @@ import { Commit } from "conventional-commits-parser";
* @param parserOpts
* @param writerOpts
*/
-declare function conventionalChangelog(
+declare function conventionalChangelog<
+ TCommit extends Commit = Commit,
+ TContext extends WriterContext = conventionalChangelogCore.Context,
+>(
options?: Options,
context?: Partial,
- gitRawCommitsOpts?: GitRawCommitsOptions,
- parserOpts?: ParserOptions,
- writerOpts?: WriterOptions,
+ gitRawCommitsOpts?: conventionalChangelogCore.GitRawCommitsOptions,
+ parserOpts?: conventionalChangelogCore.ParserOptions,
+ writerOpts?: conventionalChangelogCore.WriterOptions,
): Stream.Readable;
declare namespace conventionalChangelog {
@@ -35,7 +31,7 @@ declare namespace conventionalChangelog {
* docs. The API is the same with the following changes or additions:
*/
interface Options
- extends BaseOptions
+ extends conventionalChangelogCore.Options
{
/**
* It's recommended to use a preset so you don't have to define everything
@@ -55,4 +51,4 @@ declare namespace conventionalChangelog {
type Options =
conventionalChangelog.Options;
-export = conventionalChangelog;
+export default conventionalChangelog;
diff --git a/types/conventional-changelog/package.json b/types/conventional-changelog/package.json
index 331a7efe30fbeb..fe47d9aaee0d82 100644
--- a/types/conventional-changelog/package.json
+++ b/types/conventional-changelog/package.json
@@ -1,7 +1,8 @@
{
"private": true,
"name": "@types/conventional-changelog",
- "version": "3.1.9999",
+ "type": "module",
+ "version": "6.0.9999",
"projects": [
"https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog#readme"
],
diff --git a/types/git-raw-commits/git-raw-commits-tests.ts b/types/git-raw-commits/git-raw-commits-tests.ts
index 691b48a817d921..c3c6d2a7c2b5e5 100644
--- a/types/git-raw-commits/git-raw-commits-tests.ts
+++ b/types/git-raw-commits/git-raw-commits-tests.ts
@@ -1,18 +1,11 @@
"use strict";
-import gitRawCommits from "git-raw-commits";
+import { getRawCommits, getRawCommitsStream, GitOptions } from "git-raw-commits";
-declare const execOptions: gitRawCommits.ExecOptions;
-declare const gitOptions: gitRawCommits.GitOptions;
+declare const gitOptions: GitOptions;
-// $ExpectType Readable
-gitRawCommits(gitOptions);
+// $ExpectType AsyncGenerator
+getRawCommits(gitOptions);
// $ExpectType Readable
-gitRawCommits(gitOptions, execOptions);
-
-// @ts-expect-error
-gitRawCommits();
-
-// @ts-expect-error
-gitRawCommits(execOptions, gitOptions);
+getRawCommitsStream(gitOptions);
diff --git a/types/git-raw-commits/index.d.ts b/types/git-raw-commits/index.d.ts
index 73a556ad7d788d..712bea1f1877d5 100644
--- a/types/git-raw-commits/index.d.ts
+++ b/types/git-raw-commits/index.d.ts
@@ -3,79 +3,84 @@
import * as Stream from "stream";
/**
- * Returns a readable stream. Stream is split to break on each commit.
+ * Please check the available options at http://git-scm.com/docs/git-log.
*
- * @param gitOpts
- * @param execOpts Options to pass to `git` `childProcess`.
+ * @remarks
+ * Single dash arguments are not supported because of https://github.com/sindresorhus/dargs/blob/master/index.js#L5.
+ *
+ * @remarks
+ * For `` we can also use `..` pattern, and this
+ * module has the following extra options for shortcut of this pattern:
+ *
+ * * `from`
+ * * `to`
+ *
+ * This module also have the following additions:
+ *
+ * * `format`
+ * * `debug`
+ * * `path`
*/
-declare function gitRawCommits(
- gitOptions: gitRawCommits.GitOptions,
- execOptions?: gitRawCommits.ExecOptions,
-): Stream.Readable;
-
-declare namespace gitRawCommits {
+export interface GitOptions {
/**
- * Options to pass to `git` `childProcess`.
+ * Options to pass to `git` `childProcess`. Current working directory to run git.
+ *
+ * @default
+ * process.cwd()
*/
- interface ExecOptions {
- /**
- * Current working directory to execute git in.
- */
- cwd?: string | undefined;
- }
+ cwd?: string;
/**
- * Please check the available options at http://git-scm.com/docs/git-log.
- *
- * @remarks
- * Single dash arguments are not supported because of https://github.com/sindresorhus/dargs/blob/master/index.js#L5.
- *
- * @remarks
- * For `` we can also use `..` pattern, and this
- * module has the following extra options for shortcut of this pattern:
+ * A function to get debug information.
*
- * * `from`
- * * `to`
- *
- * This module also have the following additions:
- *
- * * `format`
- * * `debug`
- * * `path`
+ * @default
+ * false
*/
- interface GitOptions {
- /**
- * @default
- * ''
- */
- from?: string | undefined;
+ debug?: boolean | ((message: any) => void);
- /**
- * @default
- * 'HEAD'
- */
- to?: string | undefined;
+ /**
+ * Ignore commits that match provided string or RegExp.
+ */
+ ignore?: string | RegExp;
- /**
- * Please check http://git-scm.com/docs/git-log for format options.
- *
- * @default
- * '%B'
- */
- format?: string | undefined;
+ /**
+ * Only commits that are modifying this path.
+ */
+ path?: string | string[];
- /**
- * A function to get debug information.
- */
- debug?: ((message: any) => void) | undefined;
+ /**
+ * Starting commit reference or hash.
+ *
+ * @default
+ * ''
+ */
+ from?: string;
- /**
- * Filter commits to the path provided.
- */
- path?: string | undefined;
+ /**
+ * Ending commit reference or hash.
+ *
+ * @default
+ * 'HEAD'
+ */
+ to?: string;
+
+ /**
+ * Format of the commit.
+ *
+ * @default
+ * '%B'
+ */
+ format?: string;
- [options: string]: any;
- }
+ [options: string]: any;
}
-export = gitRawCommits;
+/**
+ * Get raw commits from git-log.
+ */
+export function getRawCommits(options?: GitOptions): AsyncGenerator;
+
+/**
+ * Get raw commits stream from git-log.
+ */
+export function getRawCommitsStream(options?: GitOptions): Stream.Readable;
diff --git a/types/git-raw-commits/package.json b/types/git-raw-commits/package.json
index cd49e86628649f..48413001dac81f 100644
--- a/types/git-raw-commits/package.json
+++ b/types/git-raw-commits/package.json
@@ -1,7 +1,8 @@
{
"private": true,
"name": "@types/git-raw-commits",
- "version": "2.0.9999",
+ "type": "module",
+ "version": "5.0.9999",
"projects": [
"https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/git-raw-commits#readme"
],
diff --git a/types/merge-refs/.npmignore b/types/merge-refs/.npmignore
deleted file mode 100644
index 93e307400a5456..00000000000000
--- a/types/merge-refs/.npmignore
+++ /dev/null
@@ -1,5 +0,0 @@
-*
-!**/*.d.ts
-!**/*.d.cts
-!**/*.d.mts
-!**/*.d.*.ts
diff --git a/types/merge-refs/index.d.ts b/types/merge-refs/index.d.ts
deleted file mode 100644
index 705e68a674dacb..00000000000000
--- a/types/merge-refs/index.d.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-import * as React from "react";
-
-declare function merge_refs(...refs: Array>): (instance: T) => void;
-export default merge_refs;
diff --git a/types/merge-refs/merge-refs-tests.ts b/types/merge-refs/merge-refs-tests.ts
deleted file mode 100644
index 7e5db6a9088e3e..00000000000000
--- a/types/merge-refs/merge-refs-tests.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-import React = require("react");
-import mergeRefs from "merge-refs";
-
-mergeRefs(React.createRef(), React.createRef());
-mergeRefs(
- (instance: HTMLDivElement | null) => {},
- (instance: HTMLDivElement | null) => {},
-);
diff --git a/types/merge-refs/package.json b/types/merge-refs/package.json
deleted file mode 100644
index 95deafd62db839..00000000000000
--- a/types/merge-refs/package.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "private": true,
- "name": "@types/merge-refs",
- "version": "1.0.9999",
- "projects": [
- "https://github.com/wojtekmaj/merge-refs"
- ],
- "dependencies": {
- "@types/react": "*"
- },
- "devDependencies": {
- "@types/merge-refs": "workspace:."
- },
- "owners": [
- {
- "name": "Jakub Skoneczny",
- "githubUsername": "Skona27"
- }
- ]
-}
diff --git a/types/merge-refs/tsconfig.json b/types/merge-refs/tsconfig.json
deleted file mode 100644
index 015bb90f784eb1..00000000000000
--- a/types/merge-refs/tsconfig.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "compilerOptions": {
- "module": "node16",
- "lib": [
- "es6"
- ],
- "noImplicitAny": true,
- "noImplicitThis": true,
- "strictFunctionTypes": true,
- "strictNullChecks": true,
- "types": [],
- "noEmit": true,
- "allowSyntheticDefaultImports": true,
- "forceConsistentCasingInFileNames": true
- },
- "files": [
- "index.d.ts",
- "merge-refs-tests.ts"
- ]
-}
diff --git a/types/node/fs/promises.d.ts b/types/node/fs/promises.d.ts
index 6dc864a059e7b1..2dc296cf780498 100644
--- a/types/node/fs/promises.d.ts
+++ b/types/node/fs/promises.d.ts
@@ -112,7 +112,7 @@ declare module "fs/promises" {
appendFile(
data: string | Uint8Array,
options?:
- | (ObjectEncodingOptions & FlagAndOpenMode & { flush?: boolean | undefined })
+ | (ObjectEncodingOptions & Abortable)
| BufferEncoding
| null,
): Promise;
@@ -402,7 +402,7 @@ declare module "fs/promises" {
writeFile(
data: string | Uint8Array,
options?:
- | (ObjectEncodingOptions & FlagAndOpenMode & Abortable & { flush?: boolean | undefined })
+ | (ObjectEncodingOptions & Abortable)
| BufferEncoding
| null,
): Promise;
diff --git a/types/node/test/fs.ts b/types/node/test/fs.ts
index 5bd4d6e034870b..9d161dbac4f0fb 100644
--- a/types/node/test/fs.ts
+++ b/types/node/test/fs.ts
@@ -1055,3 +1055,14 @@ const anyStatFs: fs.StatsFs | fs.BigIntStatsFs = fs.statfsSync(".", { bigint: Ma
entry; // $ExpectType Dirent | string
}
});
+
+(async () => {
+ const fd = await fs.promises.open("/tmp/tmp.txt", "r");
+ fd.writeFile("test", { signal: new AbortSignal(), encoding: "utf-8" });
+ // @ts-expect-error
+ fd.writeFile("test", { mode: 0o777, flush: true, flag: "a" });
+
+ fd.appendFile("test", { signal: new AbortSignal(), encoding: "utf-8" });
+ // @ts-expect-error
+ fd.appendFile("test", { mode: 0o777, flush: true, flag: "a" });
+});
diff --git a/types/node/v16/fs/promises.d.ts b/types/node/v16/fs/promises.d.ts
index 5bb0a450c148a9..a1cb5541f0e88d 100644
--- a/types/node/v16/fs/promises.d.ts
+++ b/types/node/v16/fs/promises.d.ts
@@ -94,7 +94,7 @@ declare module "fs/promises" {
*/
appendFile(
data: string | Uint8Array,
- options?: (ObjectEncodingOptions & FlagAndOpenMode) | BufferEncoding | null,
+ options?: (ObjectEncodingOptions & Abortable) | BufferEncoding | null,
): Promise;
/**
* Changes the ownership of the file. A wrapper for [`chown(2)`](http://man7.org/linux/man-pages/man2/chown.2.html).
@@ -337,7 +337,7 @@ declare module "fs/promises" {
*/
writeFile(
data: string | Uint8Array,
- options?: (ObjectEncodingOptions & FlagAndOpenMode & Abortable) | BufferEncoding | null,
+ options?: (ObjectEncodingOptions & Abortable) | BufferEncoding | null,
): Promise;
/**
* Write `buffer` to the file.
diff --git a/types/node/v16/test/fs.ts b/types/node/v16/test/fs.ts
index da866cd918320b..d7a8fe45a0b85d 100644
--- a/types/node/v16/test/fs.ts
+++ b/types/node/v16/test/fs.ts
@@ -792,3 +792,14 @@ const anyStats: fs.Stats | fs.BigIntStats = fs.statSync(".", { bigint: Math.rand
await copyFile("source.txt", "destination.txt", constants.COPYFILE_EXCL);
await access("/etc/passwd", constants.R_OK | constants.W_OK);
});
+
+(async () => {
+ const fd = await fs.promises.open("/tmp/tmp.txt", "r");
+ fd.writeFile("test", { signal: new AbortSignal(), encoding: "utf-8" });
+ // @ts-expect-error
+ fd.writeFile("test", { mode: 0o777, flush: true, flag: "a" });
+
+ fd.appendFile("test", { signal: new AbortSignal(), encoding: "utf-8" });
+ // @ts-expect-error
+ fd.appendFile("test", { mode: 0o777, flush: true, flag: "a" });
+});
diff --git a/types/node/v18/fs/promises.d.ts b/types/node/v18/fs/promises.d.ts
index 7d93cd4106c6f5..631a776da9a364 100644
--- a/types/node/v18/fs/promises.d.ts
+++ b/types/node/v18/fs/promises.d.ts
@@ -108,7 +108,7 @@ declare module "fs/promises" {
*/
appendFile(
data: string | Uint8Array,
- options?: (ObjectEncodingOptions & FlagAndOpenMode) | BufferEncoding | null,
+ options?: (ObjectEncodingOptions & Abortable) | BufferEncoding | null,
): Promise;
/**
* Changes the ownership of the file. A wrapper for [`chown(2)`](http://man7.org/linux/man-pages/man2/chown.2.html).
@@ -390,7 +390,7 @@ declare module "fs/promises" {
*/
writeFile(
data: string | Uint8Array,
- options?: (ObjectEncodingOptions & FlagAndOpenMode & Abortable) | BufferEncoding | null,
+ options?: (ObjectEncodingOptions & Abortable) | BufferEncoding | null,
): Promise;
/**
* Write `buffer` to the file.
diff --git a/types/node/v18/test/fs.ts b/types/node/v18/test/fs.ts
index 8fc9f50c6d41bb..c556d1b18e5c76 100644
--- a/types/node/v18/test/fs.ts
+++ b/types/node/v18/test/fs.ts
@@ -873,3 +873,14 @@ const anyStatFs: fs.StatsFs | fs.BigIntStatsFs = fs.statfsSync(".", { bigint: Ma
await copyFile("source.txt", "destination.txt", constants.COPYFILE_EXCL);
await access("/etc/passwd", constants.R_OK | constants.W_OK);
});
+
+(async () => {
+ const fd = await fs.promises.open("/tmp/tmp.txt", "r");
+ fd.writeFile("test", { signal: new AbortSignal(), encoding: "utf-8" });
+ // @ts-expect-error
+ fd.writeFile("test", { mode: 0o777, flush: true, flag: "a" });
+
+ fd.appendFile("test", { signal: new AbortSignal(), encoding: "utf-8" });
+ // @ts-expect-error
+ fd.appendFile("test", { mode: 0o777, flush: true, flag: "a" });
+});
diff --git a/types/node/v20/fs/promises.d.ts b/types/node/v20/fs/promises.d.ts
index d4bacb962241f8..03d2d628926dbb 100644
--- a/types/node/v20/fs/promises.d.ts
+++ b/types/node/v20/fs/promises.d.ts
@@ -109,7 +109,7 @@ declare module "fs/promises" {
appendFile(
data: string | Uint8Array,
options?:
- | (ObjectEncodingOptions & FlagAndOpenMode & { flush?: boolean | undefined })
+ | (ObjectEncodingOptions & Abortable)
| BufferEncoding
| null,
): Promise;
@@ -395,7 +395,7 @@ declare module "fs/promises" {
writeFile(
data: string | Uint8Array,
options?:
- | (ObjectEncodingOptions & FlagAndOpenMode & Abortable & { flush?: boolean | undefined })
+ | (ObjectEncodingOptions & Abortable)
| BufferEncoding
| null,
): Promise;
diff --git a/types/node/v20/test/fs.ts b/types/node/v20/test/fs.ts
index db0fa28ad4082f..c2dff5e2853a91 100644
--- a/types/node/v20/test/fs.ts
+++ b/types/node/v20/test/fs.ts
@@ -902,3 +902,14 @@ const anyStatFs: fs.StatsFs | fs.BigIntStatsFs = fs.statfsSync(".", { bigint: Ma
await copyFile("source.txt", "destination.txt", constants.COPYFILE_EXCL);
await access("/etc/passwd", constants.R_OK | constants.W_OK);
});
+
+(async () => {
+ const fd = await fs.promises.open("/tmp/tmp.txt", "r");
+ fd.writeFile("test", { signal: new AbortSignal(), encoding: "utf-8" });
+ // @ts-expect-error
+ fd.writeFile("test", { mode: 0o777, flush: true, flag: "a" });
+
+ fd.appendFile("test", { signal: new AbortSignal(), encoding: "utf-8" });
+ // @ts-expect-error
+ fd.appendFile("test", { mode: 0o777, flush: true, flag: "a" });
+});
diff --git a/types/office-js-preview/index.d.ts b/types/office-js-preview/index.d.ts
index bfa756a5830658..be68f62ec94924 100644
--- a/types/office-js-preview/index.d.ts
+++ b/types/office-js-preview/index.d.ts
@@ -129335,6 +129335,155 @@ declare namespace PowerPoint {
*/
toJSON(): PowerPoint.Interfaces.CustomXmlPartCollectionData;
}
+ /**
+ * Specifies the type of a placeholder.
+ *
+ * @remarks
+ * [Api set: PowerPointApi BETA (PREVIEW ONLY)]
+ * @beta
+ */
+ enum PlaceholderType {
+ /**
+ * The placeholder is unsupported.
+ * @remarks
+ * [Api set: PowerPointApi BETA (PREVIEW ONLY)]
+ * @beta
+ */
+ unsupported = "Unsupported",
+ /**
+ * The placeholder is for a date.
+ * @remarks
+ * [Api set: PowerPointApi BETA (PREVIEW ONLY)]
+ * @beta
+ */
+ date = "Date",
+ /**
+ * The placeholder is for a slide number.
+ * @remarks
+ * [Api set: PowerPointApi BETA (PREVIEW ONLY)]
+ * @beta
+ */
+ slideNumber = "SlideNumber",
+ /**
+ * The placeholder is for a footer.
+ * @remarks
+ * [Api set: PowerPointApi BETA (PREVIEW ONLY)]
+ * @beta
+ */
+ footer = "Footer",
+ /**
+ * The placeholder is for a header.
+ * @remarks
+ * [Api set: PowerPointApi BETA (PREVIEW ONLY)]
+ * @beta
+ */
+ header = "Header",
+ /**
+ * The placeholder is for a title.
+ * @remarks
+ * [Api set: PowerPointApi BETA (PREVIEW ONLY)]
+ * @beta
+ */
+ title = "Title",
+ /**
+ * The placeholder is for a body.
+ * @remarks
+ * [Api set: PowerPointApi BETA (PREVIEW ONLY)]
+ * @beta
+ */
+ body = "Body",
+ /**
+ * The placeholder is for a center title.
+ * @remarks
+ * [Api set: PowerPointApi BETA (PREVIEW ONLY)]
+ * @beta
+ */
+ centerTitle = "CenterTitle",
+ /**
+ * The placeholder is for a subtitle.
+ * @remarks
+ * [Api set: PowerPointApi BETA (PREVIEW ONLY)]
+ * @beta
+ */
+ subtitle = "Subtitle",
+ /**
+ * The placeholder is for a vertical title.
+ * @remarks
+ * [Api set: PowerPointApi BETA (PREVIEW ONLY)]
+ * @beta
+ */
+ verticalTitle = "VerticalTitle",
+ /**
+ * The placeholder is for a vertical body.
+ * @remarks
+ * [Api set: PowerPointApi BETA (PREVIEW ONLY)]
+ * @beta
+ */
+ verticalBody = "VerticalBody",
+ /**
+ * The placeholder is for generic content.
+ * @remarks
+ * [Api set: PowerPointApi BETA (PREVIEW ONLY)]
+ * @beta
+ */
+ content = "Content",
+ /**
+ * The placeholder is for a chart.
+ * @remarks
+ * [Api set: PowerPointApi BETA (PREVIEW ONLY)]
+ * @beta
+ */
+ chart = "Chart",
+ /**
+ * The placeholder is for a table.
+ * @remarks
+ * [Api set: PowerPointApi BETA (PREVIEW ONLY)]
+ * @beta
+ */
+ table = "Table",
+ /**
+ * The placeholder is for an online picture.
+ * @remarks
+ * [Api set: PowerPointApi BETA (PREVIEW ONLY)]
+ * @beta
+ */
+ onlinePicture = "OnlinePicture",
+ /**
+ * The placeholder is for a SmartArt.
+ * @remarks
+ * [Api set: PowerPointApi BETA (PREVIEW ONLY)]
+ * @beta
+ */
+ smartArt = "SmartArt",
+ /**
+ * The placeholder is for media.
+ * @remarks
+ * [Api set: PowerPointApi BETA (PREVIEW ONLY)]
+ * @beta
+ */
+ media = "Media",
+ /**
+ * The placeholder is for generic vertical content.
+ * @remarks
+ * [Api set: PowerPointApi BETA (PREVIEW ONLY)]
+ * @beta
+ */
+ verticalContent = "VerticalContent",
+ /**
+ * The placeholder is for a picture.
+ * @remarks
+ * [Api set: PowerPointApi BETA (PREVIEW ONLY)]
+ * @beta
+ */
+ picture = "Picture",
+ /**
+ * The placeholder is for a cameo.
+ * @remarks
+ * [Api set: PowerPointApi BETA (PREVIEW ONLY)]
+ * @beta
+ */
+ cameo = "Cameo",
+ }
/**
* Specifies the type of a shape.
*
@@ -129457,6 +129606,60 @@ declare namespace PowerPoint {
*/
textBox = "TextBox",
}
+ /**
+ * Represents the properties of a `placeholder` shape.
+ *
+ * @remarks
+ * [Api set: PowerPointApi BETA (PREVIEW ONLY)]
+ * @beta
+ */
+ class PlaceholderFormat extends OfficeExtension.ClientObject {
+ /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */
+ context: RequestContext;
+ /**
+ * Gets the type of the shape contained within the placeholder. See {@link PowerPoint.ShapeType} for details.
+ Returns `null` if the placeholder is empty.
+ *
+ * @remarks
+ * [Api set: PowerPointApi BETA (PREVIEW ONLY)]
+ * @beta
+ */
+ readonly containedType: ShapeType | null;
+ /**
+ * Returns the type of this placeholder. See {@link PowerPoint.PlaceholderType} for details.
+ *
+ * @remarks
+ * [Api set: PowerPointApi BETA (PREVIEW ONLY)]
+ * @beta
+ */
+ readonly type: PowerPoint.PlaceholderType | "Unsupported" | "Date" | "SlideNumber" | "Footer" | "Header" | "Title" | "Body" | "CenterTitle" | "Subtitle" | "VerticalTitle" | "VerticalBody" | "Content" | "Chart" | "Table" | "OnlinePicture" | "SmartArt" | "Media" | "VerticalContent" | "Picture" | "Cameo";
+ /**
+ * Queues up a command to load the specified properties of the object. You must call `context.sync()` before reading the properties.
+ *
+ * @param options Provides options for which properties of the object to load.
+ */
+ load(options?: PowerPoint.Interfaces.PlaceholderFormatLoadOptions): PowerPoint.PlaceholderFormat;
+ /**
+ * Queues up a command to load the specified properties of the object. You must call `context.sync()` before reading the properties.
+ *
+ * @param propertyNames A comma-delimited string or an array of strings that specify the properties to load.
+ */
+ load(propertyNames?: string | string[]): PowerPoint.PlaceholderFormat;
+ /**
+ * Queues up a command to load the specified properties of the object. You must call `context.sync()` before reading the properties.
+ *
+ * @param propertyNamesAndPaths `propertyNamesAndPaths.select` is a comma-delimited string that specifies the properties to load, and `propertyNamesAndPaths.expand` is a comma-delimited string that specifies the navigation properties to load.
+ */
+ load(propertyNamesAndPaths?: {
+ select?: string;
+ expand?: string;
+ }): PowerPoint.PlaceholderFormat;
+ /**
+ * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that's passed to it.)
+ * Whereas the original `PowerPoint.PlaceholderFormat` object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `PowerPoint.Interfaces.PlaceholderFormatData`) that contains shallow copies of any loaded child properties from the original object.
+ */
+ toJSON(): PowerPoint.Interfaces.PlaceholderFormatData;
+ }
/**
* Represents a single hyperlink.
*
@@ -132771,6 +132974,15 @@ declare namespace PowerPoint {
* @beta
*/
readonly parentGroup: PowerPoint.Shape;
+ /**
+ * Returns the properties that apply specifically to this placeholder.
+ If the shape type isn't `placeholder`, then this method returns the `GeneralException` error.
+ *
+ * @remarks
+ * [Api set: PowerPointApi BETA (PREVIEW ONLY)]
+ * @beta
+ */
+ readonly placeholderFormat: PowerPoint.PlaceholderFormat;
/**
* Returns a collection of tags in the shape.
*
@@ -133956,6 +134168,26 @@ declare namespace PowerPoint {
interface CustomXmlPartCollectionData {
items?: PowerPoint.Interfaces.CustomXmlPartData[];
}
+ /** An interface describing the data returned by calling `placeholderFormat.toJSON()`. */
+ interface PlaceholderFormatData {
+ /**
+ * Gets the type of the shape contained within the placeholder. See {@link PowerPoint.ShapeType} for details.
+ Returns `null` if the placeholder is empty.
+ *
+ * @remarks
+ * [Api set: PowerPointApi BETA (PREVIEW ONLY)]
+ * @beta
+ */
+ containedType?: ShapeType | null;
+ /**
+ * Returns the type of this placeholder. See {@link PowerPoint.PlaceholderType} for details.
+ *
+ * @remarks
+ * [Api set: PowerPointApi BETA (PREVIEW ONLY)]
+ * @beta
+ */
+ type?: PowerPoint.PlaceholderType | "Unsupported" | "Date" | "SlideNumber" | "Footer" | "Header" | "Title" | "Body" | "CenterTitle" | "Subtitle" | "VerticalTitle" | "VerticalBody" | "Content" | "Chart" | "Table" | "OnlinePicture" | "SmartArt" | "Media" | "VerticalContent" | "Picture" | "Cameo";
+ }
/** An interface describing the data returned by calling `hyperlink.toJSON()`. */
interface HyperlinkData {
/**
@@ -134592,6 +134824,36 @@ declare namespace PowerPoint {
*/
namespaceUri?: boolean;
}
+ /**
+ * Represents the properties of a `placeholder` shape.
+ *
+ * @remarks
+ * [Api set: PowerPointApi BETA (PREVIEW ONLY)]
+ * @beta
+ */
+ interface PlaceholderFormatLoadOptions {
+ /**
+ Specifying `$all` for the load options loads all the scalar properties (such as `Range.address`) but not the navigational properties (such as `Range.format.fill.color`).
+ */
+ $all?: boolean;
+ /**
+ * Gets the type of the shape contained within the placeholder. See {@link PowerPoint.ShapeType} for details.
+ Returns `null` if the placeholder is empty.
+ *
+ * @remarks
+ * [Api set: PowerPointApi BETA (PREVIEW ONLY)]
+ * @beta
+ */
+ containedType?: boolean;
+ /**
+ * Returns the type of this placeholder. See {@link PowerPoint.PlaceholderType} for details.
+ *
+ * @remarks
+ * [Api set: PowerPointApi BETA (PREVIEW ONLY)]
+ * @beta
+ */
+ type?: boolean;
+ }
/**
* Represents a single hyperlink.
*
@@ -134743,43 +135005,52 @@ declare namespace PowerPoint {
*/
$all?: boolean;
/**
- * For EACH ITEM in the collection: Returns the fill formatting of this shape.
- *
- * @remarks
- * [Api set: PowerPointApi 1.4]
- */
+ * For EACH ITEM in the collection: Returns the fill formatting of this shape.
+ *
+ * @remarks
+ * [Api set: PowerPointApi 1.4]
+ */
fill?: PowerPoint.Interfaces.ShapeFillLoadOptions;
/**
- * For EACH ITEM in the collection: Returns the `ShapeGroup` associated with the shape.
+ * For EACH ITEM in the collection: Returns the `ShapeGroup` associated with the shape.
If the shape type isn't `group`, then this method returns the `GeneralException` error.
- *
- * @remarks
- * [Api set: PowerPointApi BETA (PREVIEW ONLY)]
- * @beta
- */
+ *
+ * @remarks
+ * [Api set: PowerPointApi BETA (PREVIEW ONLY)]
+ * @beta
+ */
group?: PowerPoint.Interfaces.ShapeGroupLoadOptions;
/**
- * For EACH ITEM in the collection: Returns the line formatting of this shape.
- *
- * @remarks
- * [Api set: PowerPointApi 1.4]
- */
+ * For EACH ITEM in the collection: Returns the line formatting of this shape.
+ *
+ * @remarks
+ * [Api set: PowerPointApi 1.4]
+ */
lineFormat?: PowerPoint.Interfaces.ShapeLineFormatLoadOptions;
/**
- * For EACH ITEM in the collection: Returns the parent group of this shape.
+ * For EACH ITEM in the collection: Returns the parent group of this shape.
If the shape isn't part of a group, then this method returns the `GeneralException` error.
- *
- * @remarks
- * [Api set: PowerPointApi BETA (PREVIEW ONLY)]
- * @beta
- */
+ *
+ * @remarks
+ * [Api set: PowerPointApi BETA (PREVIEW ONLY)]
+ * @beta
+ */
parentGroup?: PowerPoint.Interfaces.ShapeLoadOptions;
/**
- * For EACH ITEM in the collection: Returns the text frame object of this shape.
- *
- * @remarks
- * [Api set: PowerPointApi 1.4]
- */
+ * For EACH ITEM in the collection: Returns the properties that apply specifically to this placeholder.
+ If the shape type isn't `placeholder`, then this method returns the `GeneralException` error.
+ *
+ * @remarks
+ * [Api set: PowerPointApi BETA (PREVIEW ONLY)]
+ * @beta
+ */
+ placeholderFormat?: PowerPoint.Interfaces.PlaceholderFormatLoadOptions;
+ /**
+ * For EACH ITEM in the collection: Returns the text frame object of this shape.
+ *
+ * @remarks
+ * [Api set: PowerPointApi 1.4]
+ */
textFrame?: PowerPoint.Interfaces.TextFrameLoadOptions;
/**
* For EACH ITEM in the collection: Specifies the height, in points, of the shape. Throws an `InvalidArgument` exception when set with a negative value.
@@ -135044,43 +135315,52 @@ declare namespace PowerPoint {
*/
$all?: boolean;
/**
- * For EACH ITEM in the collection: Returns the fill formatting of this shape.
- *
- * @remarks
- * [Api set: PowerPointApi 1.5]
- */
+ * For EACH ITEM in the collection: Returns the fill formatting of this shape.
+ *
+ * @remarks
+ * [Api set: PowerPointApi 1.5]
+ */
fill?: PowerPoint.Interfaces.ShapeFillLoadOptions;
/**
- * For EACH ITEM in the collection: Returns the `ShapeGroup` associated with the shape.
- If the shape type isn't `group`, then this method returns the `GeneralException` error.
- *
- * @remarks
- * [Api set: PowerPointApi BETA (PREVIEW ONLY)]
- * @beta
- */
+ * For EACH ITEM in the collection: Returns the `ShapeGroup` associated with the shape.
+ If the shape type isn't `group`, then this method returns the `GeneralException` error.
+ *
+ * @remarks
+ * [Api set: PowerPointApi BETA (PREVIEW ONLY)]
+ * @beta
+ */
group?: PowerPoint.Interfaces.ShapeGroupLoadOptions;
/**
- * For EACH ITEM in the collection: Returns the line formatting of this shape.
- *
- * @remarks
- * [Api set: PowerPointApi 1.5]
- */
+ * For EACH ITEM in the collection: Returns the line formatting of this shape.
+ *
+ * @remarks
+ * [Api set: PowerPointApi 1.5]
+ */
lineFormat?: PowerPoint.Interfaces.ShapeLineFormatLoadOptions;
/**
- * For EACH ITEM in the collection: Returns the parent group of this shape.
+ * For EACH ITEM in the collection: Returns the parent group of this shape.
If the shape isn't part of a group, then this method returns the `GeneralException` error.
- *
- * @remarks
- * [Api set: PowerPointApi BETA (PREVIEW ONLY)]
- * @beta
- */
+ *
+ * @remarks
+ * [Api set: PowerPointApi BETA (PREVIEW ONLY)]
+ * @beta
+ */
parentGroup?: PowerPoint.Interfaces.ShapeLoadOptions;
/**
- * For EACH ITEM in the collection: Returns the text frame object of this shape.
- *
- * @remarks
- * [Api set: PowerPointApi 1.5]
- */
+ * For EACH ITEM in the collection: Returns the properties that apply specifically to this placeholder.
+ If the shape type isn't `placeholder`, then this method returns the `GeneralException` error.
+ *
+ * @remarks
+ * [Api set: PowerPointApi BETA (PREVIEW ONLY)]
+ * @beta
+ */
+ placeholderFormat?: PowerPoint.Interfaces.PlaceholderFormatLoadOptions;
+ /**
+ * For EACH ITEM in the collection: Returns the text frame object of this shape.
+ *
+ * @remarks
+ * [Api set: PowerPointApi 1.5]
+ */
textFrame?: PowerPoint.Interfaces.TextFrameLoadOptions;
/**
* For EACH ITEM in the collection: Specifies the height, in points, of the shape. Throws an `InvalidArgument` exception when set with a negative value.
@@ -135410,43 +135690,52 @@ declare namespace PowerPoint {
*/
$all?: boolean;
/**
- * Returns the fill formatting of this shape.
- *
- * @remarks
- * [Api set: PowerPointApi 1.4]
- */
+ * Returns the fill formatting of this shape.
+ *
+ * @remarks
+ * [Api set: PowerPointApi 1.4]
+ */
fill?: PowerPoint.Interfaces.ShapeFillLoadOptions;
/**
- * Returns the `ShapeGroup` associated with the shape.
+ * Returns the `ShapeGroup` associated with the shape.
If the shape type isn't `group`, then this method returns the `GeneralException` error.
- *
- * @remarks
- * [Api set: PowerPointApi BETA (PREVIEW ONLY)]
- * @beta
- */
+ *
+ * @remarks
+ * [Api set: PowerPointApi BETA (PREVIEW ONLY)]
+ * @beta
+ */
group?: PowerPoint.Interfaces.ShapeGroupLoadOptions;
/**
- * Returns the line formatting of this shape.
- *
- * @remarks
- * [Api set: PowerPointApi 1.4]
- */
+ * Returns the line formatting of this shape.
+ *
+ * @remarks
+ * [Api set: PowerPointApi 1.4]
+ */
lineFormat?: PowerPoint.Interfaces.ShapeLineFormatLoadOptions;
/**
- * Returns the parent group of this shape.
+ * Returns the parent group of this shape.
If the shape isn't part of a group, then this method returns the `GeneralException` error.
- *
- * @remarks
- * [Api set: PowerPointApi BETA (PREVIEW ONLY)]
- * @beta
- */
+ *
+ * @remarks
+ * [Api set: PowerPointApi BETA (PREVIEW ONLY)]
+ * @beta
+ */
parentGroup?: PowerPoint.Interfaces.ShapeLoadOptions;
/**
- * Returns the text frame object of this shape.
- *
- * @remarks
- * [Api set: PowerPointApi 1.4]
- */
+ * Returns the properties that apply specifically to this placeholder.
+ If the shape type isn't `placeholder`, then this method returns the `GeneralException` error.
+ *
+ * @remarks
+ * [Api set: PowerPointApi BETA (PREVIEW ONLY)]
+ * @beta
+ */
+ placeholderFormat?: PowerPoint.Interfaces.PlaceholderFormatLoadOptions;
+ /**
+ * Returns the text frame object of this shape.
+ *
+ * @remarks
+ * [Api set: PowerPointApi 1.4]
+ */
textFrame?: PowerPoint.Interfaces.TextFrameLoadOptions;
/**
* Specifies the height, in points, of the shape. Throws an `InvalidArgument` exception when set with a negative value.
diff --git a/types/openpgp/.eslintrc.json b/types/openpgp/.eslintrc.json
deleted file mode 100644
index 22b08eb4a82670..00000000000000
--- a/types/openpgp/.eslintrc.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "rules": {
- "@typescript-eslint/no-unsafe-function-type": "off",
- "@typescript-eslint/no-wrapper-object-types": "off"
- }
-}
diff --git a/types/openpgp/.npmignore b/types/openpgp/.npmignore
deleted file mode 100644
index 93e307400a5456..00000000000000
--- a/types/openpgp/.npmignore
+++ /dev/null
@@ -1,5 +0,0 @@
-*
-!**/*.d.ts
-!**/*.d.cts
-!**/*.d.mts
-!**/*.d.*.ts
diff --git a/types/openpgp/index.d.ts b/types/openpgp/index.d.ts
deleted file mode 100644
index 57768c1772a77f..00000000000000
--- a/types/openpgp/index.d.ts
+++ /dev/null
@@ -1,5563 +0,0 @@
-import BN = require("bn.js");
-import stream = require("stream");
-
-export {};
-type NodeStream = stream;
-type Integer = number;
-type Infinity = any;
-type ReadableStream = any;
-
-export namespace cleartext {
- /**
- * Class that represents an OpenPGP cleartext signed message.
- * See {@link https://tools.ietf.org/html/rfc4880#section-7}
- */
- class CleartextMessage {
- /**
- * @param text The cleartext of the signed message
- * @param signature The detached signature or an empty signature for unsigned messages
- */
- constructor(text: string, signature: signature.Signature);
-
- /**
- * Returns the key IDs of the keys that signed the cleartext message
- * @returns array of keyid objects
- */
- getSigningKeyIds(): any[];
-
- /**
- * Sign the cleartext message
- * @param privateKeys private keys with decrypted secret key data for signing
- * @param signature (optional) any existing detached signature
- * @param date (optional) The creation time of the signature that should be created
- * @param userIds (optional) user IDs to sign with, e.g. [ { name:'Steve Sender', email:'steve@openpgp.org' }]
- * @returns new cleartext message with signed content
- */
- sign(privateKeys: any[], signature: signature.Signature, date: Date, userIds: any[]): Promise;
-
- /**
- * Sign the cleartext message
- * @param privateKeys private keys with decrypted secret key data for signing
- * @param signature (optional) any existing detached signature
- * @param date (optional) The creation time of the signature that should be created
- * @param userIds (optional) user IDs to sign with, e.g. [ { name:'Steve Sender', email:'steve@openpgp.org' }]
- * @returns new detached signature of message content
- */
- signDetached(
- privateKeys: any[],
- signature: signature.Signature,
- date: Date,
- userIds: any[],
- ): Promise;
-
- /**
- * Verify signatures of cleartext signed message
- * @param keys array of keys to verify signatures
- * @param date (optional) Verify the signature against the given date, i.e. check signature creation time < date < expiration time
- * @returns list of signer's keyid and validity of signature
- */
- verify(keys: any[], date: Date): Promise>;
-
- /**
- * Verify signatures of cleartext signed message
- * @param keys array of keys to verify signatures
- * @param date (optional) Verify the signature against the given date, i.e. check signature creation time < date < expiration time
- * @returns list of signer's keyid and validity of signature
- */
- verifyDetached(keys: any[], date: Date): Promise>;
-
- /**
- * Get cleartext
- * @returns cleartext of message
- */
- getText(): string;
-
- /**
- * Returns ASCII armored text of cleartext signed message
- * @returns ASCII armor
- */
- armor(): string | ReadableStream;
- }
-
- /**
- * reads an OpenPGP cleartext signed message and returns a CleartextMessage object
- * @param armoredText text to be parsed
- * @returns new cleartext message object
- */
- function readArmored(armoredText: string | ReadableStream): Promise;
-
- /**
- * Creates a new CleartextMessage object from text
- * @param text
- */
- function fromText(text: string): CleartextMessage;
-}
-
-/**
- * @see module:config/config
- */
-export namespace config {
- var prefer_hash_algorithm: any;
-
- var encryption_cipher: any;
-
- var compression: any;
-
- var deflate_level: any;
-
- /**
- * Use Authenticated Encryption with Additional Data (AEAD) protection for symmetric encryption.
- * **NOT INTEROPERABLE WITH OTHER OPENPGP IMPLEMENTATIONS**
- * **FUTURE OPENPGP.JS VERSIONS MAY BREAK COMPATIBILITY WHEN USING THIS OPTION**
- */
- var aead_protect: any;
-
- /**
- * Use Authenticated Encryption with Additional Data (AEAD) protection for symmetric encryption.
- * 0 means we implement a variant of {@link https://tools.ietf.org/html/draft-ford-openpgp-format-00|this IETF draft}.
- * 4 means we implement {@link https://tools.ietf.org/html/draft-ietf-openpgp-rfc4880bis-04|RFC4880bis-04}.
- * Note that this determines how AEAD packets are parsed even when aead_protect is set to false
- */
- var aead_protect_version: any;
-
- /**
- * Default Authenticated Encryption with Additional Data (AEAD) encryption mode
- * Only has an effect when aead_protect is set to true.
- */
- var aead_mode: any;
-
- /**
- * Chunk Size Byte for Authenticated Encryption with Additional Data (AEAD) mode
- * Only has an effect when aead_protect is set to true.
- * Must be an integer value from 0 to 56.
- */
- var aead_chunk_size_byte: any;
-
- /**
- * {@link https://tools.ietf.org/html/rfc4880#section-3.7.1.3|RFC4880 3.7.1.3}:
- * Iteration Count Byte for S2K (String to Key)
- */
- var s2k_iteration_count_byte: any;
-
- /**
- * Use integrity protection for symmetric encryption
- */
- var integrity_protect: any;
-
- var ignore_mdc_error: any;
-
- var allow_unauthenticated_stream: any;
-
- var checksum_required: any;
-
- var rsa_blinding: any;
-
- /**
- * Work-around for rare GPG decryption bug when encrypting with multiple passwords.
- * **Slower and slightly less secure**
- */
- var password_collision_check: any;
-
- var revocations_expire: any;
-
- var use_native: any;
-
- var min_bytes_for_web_crypto: any;
-
- var zero_copy: any;
-
- var debug: any;
-
- var tolerant: any;
-
- var show_version: any;
-
- var show_comment: any;
-
- var versionstring: any;
-
- var commentstring: any;
-
- var keyserver: any;
-
- var node_store: any;
-
- /**
- * Max userid string length (used for parsing)
- */
- var max_userid_length: any;
-
- namespace localStorage {
- class LocalStorage {
- /**
- * This object is used for storing and retrieving configuration from HTML5 local storage.
- */
- constructor();
-
- /**
- * Reads the config out of the HTML5 local storage
- * and initializes the object config.
- * if config is null the default config will be used
- */
- read(): void;
-
- /**
- * Writes the config to HTML5 local storage
- */
- write(): void;
- }
- }
-}
-
-export class LocalStorage {
- /**
- * This object is used for storing and retrieving configuration from HTML5 local storage.
- */
- constructor();
-
- /**
- * Reads the config out of the HTML5 local storage
- * and initializes the object config.
- * if config is null the default config will be used
- */
- read(): void;
-
- /**
- * Writes the config to HTML5 local storage
- */
- write(): void;
-}
-
-/**
- * @see module:crypto/crypto
- * @see module:crypto/signature
- * @see module:crypto/public_key
- * @see module:crypto/cipher
- * @see module:crypto/random
- * @see module:crypto/hash
- */
-export namespace crypto {
- /**
- * @see module:crypto/public_key/elliptic/ecdh
- */
- namespace aes_kw {
- /**
- * AES key wrap
- * @param key
- * @param data
- * @returns
- */
- function wrap(key: string, data: string): Uint8Array;
-
- /**
- * AES key unwrap
- * @param key
- * @param data
- * @returns
- * @throws
- */
- function unwrap(key: string, data: string): Uint8Array;
- }
-
- namespace cfb {
- function encrypt(algo: any, key: any, plaintext: any, iv: any): any;
- function decrypt(algo: any, key: any, ciphertext: any, iv: any): Promise;
- }
-
- namespace cipher {
- /**
- * AES-128 encryption and decryption (ID 7)
- * @param key 128-bit key
- * @see
- * @see
- * @returns
- */
- function aes128(key: string): object;
-
- /**
- * AES-128 Block Cipher (ID 8)
- * @param key 192-bit key
- * @see
- * @see
- * @returns
- */
- function aes192(key: string): object;
-
- /**
- * AES-128 Block Cipher (ID 9)
- * @param key 256-bit key
- * @see
- * @see
- * @returns
- */
- function aes256(key: string): object;
-
- /**
- * Triple DES Block Cipher (ID 2)
- * @param key 192-bit key
- * @see
- * @returns
- */
- function tripledes(key: string): object;
-
- /**
- * CAST-128 Block Cipher (ID 3)
- * @param key 128-bit key
- * @see
- * @returns
- */
- function cast5(key: string): object;
-
- /**
- * Twofish Block Cipher (ID 10)
- * @param key 256-bit key
- * @see
- * @returns
- */
- function twofish(key: string): object;
-
- /**
- * Blowfish Block Cipher (ID 4)
- * @param key 128-bit key
- * @see
- * @returns
- */
- function blowfish(key: string): object;
-
- /**
- * Not implemented
- * @throws
- */
- function idea(): void;
- }
-
- namespace cmac {
- /**
- * This implementation of CMAC is based on the description of OMAC in
- * http://web.cs.ucdavis.edu/~rogaway/papers/eax.pdf. As per that
- * document:
- * We have made a small modification to the OMAC algorithm as it was
- * originally presented, changing one of its two constants.
- * Specifically, the constant 4 at line 85 was the constant 1/2 (the
- * multiplicative inverse of 2) in the original definition of OMAC [14].
- * The OMAC authors indicate that they will promulgate this modification
- * [15], which slightly simplifies implementations.
- */
- const blockLength: any;
-
- /**
- * xor `padding` into the end of `data`. This function implements "the
- * operation xor→ [which] xors the shorter string into the end of longer
- * one". Since data is always as least as long as padding, we can
- * simplify the implementation.
- * @param data
- * @param padding
- */
- function rightXorMut(data: Uint8Array, padding: Uint8Array): void;
- }
-
- namespace crypto {
- /**
- * Encrypts data using specified algorithm and public key parameters.
- * See {@link https://tools.ietf.org/html/rfc4880#section-9.1|RFC 4880 9.1} for public key algorithms.
- * @param algo Public key algorithm
- * @param pub_params Algorithm-specific public key parameters
- * @param data Data to be encrypted as MPI
- * @param fingerprint Recipient fingerprint
- * @returns encrypted session key parameters
- */
- function publicKeyEncrypt(
- algo: enums.publicKey,
- pub_params: Array,
- data: type.mpi.MPI,
- fingerprint: string,
- ): any[];
-
- /**
- * Decrypts data using specified algorithm and private key parameters.
- * See {@link https://tools.ietf.org/html/rfc4880#section-9.1|RFC 4880 9.1} for public key algorithms.
- * @param algo Public key algorithm
- * @param key_params Algorithm-specific public, private key parameters
- * @param data_params encrypted session key parameters
- * @param fingerprint Recipient fingerprint
- * @returns An MPI containing the decrypted data
- */
- function publicKeyDecrypt(
- algo: enums.publicKey,
- key_params: Array,
- data_params: Array,
- fingerprint: string,
- ): type.mpi.MPI;
-
- /**
- * Returns the types comprising the private key of an algorithm
- * @param algo The public key algorithm
- * @returns The array of types
- */
- function getPrivKeyParamTypes(algo: string): any[];
-
- /**
- * Returns the types comprising the public key of an algorithm
- * @param algo The public key algorithm
- * @returns The array of types
- */
- function getPubKeyParamTypes(algo: string): any[];
-
- /**
- * Returns the types comprising the encrypted session key of an algorithm
- * @param algo The public key algorithm
- * @returns The array of types
- */
- function getEncSessionKeyParamTypes(algo: string): any[];
-
- /**
- * Generate algorithm-specific key parameters
- * @param algo The public key algorithm
- * @param bits Bit length for RSA keys
- * @param oid Object identifier for ECC keys
- * @returns The array of parameters
- */
- function generateParams(algo: string, bits: Integer, oid: type.oid.OID): any[];
-
- /**
- * Generates a random byte prefix for the specified algorithm
- * See {@link https://tools.ietf.org/html/rfc4880#section-9.2|RFC 4880 9.2} for algorithms.
- * @param algo Symmetric encryption algorithm
- * @returns Random bytes with length equal to the block size of the cipher, plus the last two bytes repeated.
- */
- function getPrefixRandom(algo: enums.symmetric): Uint8Array;
-
- /**
- * Generating a session key for the specified symmetric algorithm
- * See {@link https://tools.ietf.org/html/rfc4880#section-9.2|RFC 4880 9.2} for algorithms.
- * @param algo Symmetric encryption algorithm
- * @returns Random bytes as a string to be used as a key
- */
- function generateSessionKey(algo: enums.symmetric): Uint8Array;
- }
-
- namespace eax {
- /**
- * Class to en/decrypt using EAX mode.
- * @param cipher The symmetric cipher algorithm to use e.g. 'aes128'
- * @param key The encryption key
- */
- function EAX(cipher: string, key: Uint8Array): void;
-
- /**
- * Encrypt plaintext input.
- * @param plaintext The cleartext input to be encrypted
- * @param nonce The nonce (16 bytes)
- * @param adata Associated data to sign
- * @returns The ciphertext output
- */
- function encrypt(plaintext: Uint8Array, nonce: Uint8Array, adata: Uint8Array): Promise;
-
- /**
- * Decrypt ciphertext input.
- * @param ciphertext The ciphertext input to be decrypted
- * @param nonce The nonce (16 bytes)
- * @param adata Associated data to verify
- * @returns The plaintext output
- */
- function decrypt(ciphertext: Uint8Array, nonce: Uint8Array, adata: Uint8Array): Promise;
- }
-
- namespace gcm {
- /**
- * Class to en/decrypt using GCM mode.
- * @param cipher The symmetric cipher algorithm to use e.g. 'aes128'
- * @param key The encryption key
- */
- function GCM(cipher: string, key: Uint8Array): void;
- }
-
- /**
- * @see
- * @see
- */
- namespace hash {
- /**
- * @see module:md5
- */
- var md5: any;
-
- /**
- * @see asmCrypto
- */
- var sha1: any;
-
- /**
- * @see hash.js
- */
- var sha224: any;
-
- /**
- * @see asmCrypto
- */
- var sha256: any;
-
- /**
- * @see hash.js
- */
- var sha384: any;
-
- /**
- * @see asmCrypto
- */
- var sha512: any;
-
- /**
- * @see hash.js
- */
- var ripemd: any;
-
- /**
- * Create a hash on the specified data using the specified algorithm
- * @param algo Hash algorithm type (see {@link https://tools.ietf.org/html/rfc4880#section-9.4|RFC 4880 9.4})
- * @param data Data to be hashed
- * @returns hash value
- */
- function digest(algo: enums.hash, data: Uint8Array): Promise;
-
- /**
- * Returns the hash size in bytes of the specified hash algorithm type
- * @param algo Hash algorithm type (See {@link https://tools.ietf.org/html/rfc4880#section-9.4|RFC 4880 9.4})
- * @returns Size in bytes of the resulting hash
- */
- function getHashByteLength(algo: enums.hash): Integer;
- }
-
- /**
- * @see module:packet.PublicKeyEncryptedSessionKey
- */
- namespace pkcs5 {
- /**
- * Add pkcs5 padding to a text.
- * @param msg Text to add padding
- * @returns Text with padding added
- */
- function encode(msg: string): string;
-
- /**
- * Remove pkcs5 padding from a string.
- * @param msg Text to remove padding from
- * @returns Text with padding removed
- */
- function decode(msg: string): string;
- }
-
- namespace ocb {
- /**
- * Class to en/decrypt using OCB mode.
- * @param cipher The symmetric cipher algorithm to use e.g. 'aes128'
- * @param key The encryption key
- */
- function OCB(cipher: string, key: Uint8Array): void;
-
- /**
- * Encrypt plaintext input.
- * @param plaintext The cleartext input to be encrypted
- * @param nonce The nonce (15 bytes)
- * @param adata Associated data to sign
- * @returns The ciphertext output
- */
- function encrypt(plaintext: Uint8Array, nonce: Uint8Array, adata: Uint8Array): Promise;
-
- /**
- * Decrypt ciphertext input.
- * @param ciphertext The ciphertext input to be decrypted
- * @param nonce The nonce (15 bytes)
- * @param adata Associated data to sign
- * @returns The ciphertext output
- */
- function decrypt(ciphertext: Uint8Array, nonce: Uint8Array, adata: Uint8Array): Promise;
- }
-
- /**
- * @see module:crypto/public_key/rsa
- * @see module:crypto/public_key/elliptic/ecdh
- * @see module:packet.PublicKeyEncryptedSessionKey
- */
- namespace pkcs1 {
- namespace eme {
- /**
- * Create a EME-PKCS1-v1_5 padded message
- * @see
- * @param M message to be encoded
- * @param k the length in octets of the key modulus
- * @returns EME-PKCS1 padded message
- */
- function encode(M: string, k: Integer): Promise;
-
- /**
- * Decode a EME-PKCS1-v1_5 padded message
- * @see
- * @param EM encoded message, an octet string
- * @returns message, an octet string
- */
- function decode(EM: string): string;
- }
-
- namespace emsa {
- /**
- * Create a EMSA-PKCS1-v1_5 padded message
- * @see
- * @param algo Hash algorithm type used
- * @param hashed message to be encoded
- * @param emLen intended length in octets of the encoded message
- * @returns encoded message
- */
- function encode(algo: Integer, hashed: Uint8Array, emLen: Integer): string;
- }
-
- /**
- * ASN1 object identifiers for hashes
- * @see
- */
- const hash_headers: any;
- }
-
- namespace public_key {
- namespace dsa {
- /**
- * DSA Sign function
- * @param hash_algo
- * @param hashed
- * @param g
- * @param p
- * @param q
- * @param x
- * @returns
- */
- function sign(hash_algo: Integer, hashed: Uint8Array, g: BN, p: BN, q: BN, x: BN): object;
-
- /**
- * DSA Verify function
- * @param hash_algo
- * @param r
- * @param s
- * @param hashed
- * @param g
- * @param p
- * @param q
- * @param y
- * @returns BN
- */
- function verify(hash_algo: Integer, r: BN, s: BN, hashed: Uint8Array, g: BN, p: BN, q: BN, y: BN): any;
- }
-
- namespace elgamal {
- /**
- * ElGamal Encryption function
- * @param m
- * @param p
- * @param g
- * @param y
- * @returns
- */
- function encrypt(m: BN, p: BN, g: BN, y: BN): object;
-
- /**
- * ElGamal Encryption function
- * @param c1
- * @param c2
- * @param p
- * @param x
- * @returns BN
- */
- function decrypt(c1: BN, c2: BN, p: BN, x: BN): any;
- }
-
- /**
- * @see module:crypto/public_key/elliptic/curve
- * @see module:crypto/public_key/elliptic/ecdh
- * @see module:crypto/public_key/elliptic/ecdsa
- * @see module:crypto/public_key/elliptic/eddsa
- */
- namespace elliptic {
- namespace curve {
- class Curve {}
- }
-
- namespace ecdh {
- /**
- * Generate ECDHE ephemeral key and secret from public key
- * @param curve Elliptic curve object
- * @param Q Recipient public key
- * @returns Returns public part of ephemeral key and generated ephemeral secret
- */
- function genPublicEphemeralKey(curve: curve.Curve, Q: Uint8Array): Promise<{ V: Uint8Array; S: BN }>;
-
- /**
- * Encrypt and wrap a session key
- * @param oid Elliptic curve object identifier
- * @param cipher_algo Symmetric cipher to use
- * @param hash_algo Hash algorithm to use
- * @param m Value derived from session key (RFC 6637)
- * @param Q Recipient public key
- * @param fingerprint Recipient fingerprint
- * @returns Returns public part of ephemeral key and encoded session key
- */
- function encrypt(
- oid: type.oid.OID,
- cipher_algo: enums.symmetric,
- hash_algo: enums.hash,
- m: type.mpi.MPI,
- Q: Uint8Array,
- fingerprint: string,
- ): Promise<{ V: BN; C: BN }>;
-
- /**
- * Generate ECDHE secret from private key and public part of ephemeral key
- * @param curve Elliptic curve object
- * @param V Public part of ephemeral key
- * @param d Recipient private key
- * @returns Generated ephemeral secret
- */
- function genPrivateEphemeralKey(curve: curve.Curve, V: Uint8Array, d: Uint8Array): Promise;
-
- /**
- * Decrypt and unwrap the value derived from session key
- * @param oid Elliptic curve object identifier
- * @param cipher_algo Symmetric cipher to use
- * @param hash_algo Hash algorithm to use
- * @param V Public part of ephemeral key
- * @param C Encrypted and wrapped value derived from session key
- * @param d Recipient private key
- * @param fingerprint Recipient fingerprint
- * @returns Value derived from session
- */
- function decrypt(
- oid: type.oid.OID,
- cipher_algo: enums.symmetric,
- hash_algo: enums.hash,
- V: Uint8Array,
- C: Uint8Array,
- d: Uint8Array,
- fingerprint: string,
- ): Promise;
- }
-
- namespace ecdsa {
- /**
- * Sign a message using the provided key
- * @param oid Elliptic curve object identifier
- * @param hash_algo Hash algorithm used to sign
- * @param m Message to sign
- * @param d Private key used to sign the message
- * @param hashed The hashed message
- * @returns Signature of the message
- */
- function sign(
- oid: type.oid.OID,
- hash_algo: enums.hash,
- m: Uint8Array,
- d: Uint8Array,
- hashed: Uint8Array,
- ): object;
-
- /**
- * Verifies if a signature is valid for a message
- * @param oid Elliptic curve object identifier
- * @param hash_algo Hash algorithm used in the signature
- * @param signature Signature to verify
- * @param m Message to verify
- * @param Q Public key used to verify the message
- * @param hashed The hashed message
- * @returns
- */
- function verify(
- oid: type.oid.OID,
- hash_algo: enums.hash,
- signature: object,
- m: Uint8Array,
- Q: Uint8Array,
- hashed: Uint8Array,
- ): boolean;
- }
-
- namespace eddsa {
- /**
- * Sign a message using the provided keygit
- * @param oid Elliptic curve object identifier
- * @param hash_algo Hash algorithm used to sign
- * @param m Message to sign
- * @param d Private key used to sign
- * @param hashed The hashed message
- * @returns Signature of the message
- */
- function sign(
- oid: type.oid.OID,
- hash_algo: enums.hash,
- m: Uint8Array,
- d: Uint8Array,
- hashed: Uint8Array,
- ): object;
-
- /**
- * Verifies if a signature is valid for a message
- * @param oid Elliptic curve object identifier
- * @param hash_algo Hash algorithm used in the signature
- * @param signature Signature to verify the message
- * @param m Message to verify
- * @param Q Public key used to verify the message
- * @param hashed The hashed message
- * @returns
- */
- function verify(
- oid: type.oid.OID,
- hash_algo: enums.hash,
- signature: object,
- m: Uint8Array,
- Q: Uint8Array,
- hashed: Uint8Array,
- ): boolean;
- }
-
- namespace key {
- class KeyPair {}
- }
- }
-
- namespace prime {
- /**
- * Probabilistic random number generator
- * @param bits Bit length of the prime
- * @param e Optional RSA exponent to check against the prime
- * @param k Optional number of iterations of Miller-Rabin test
- * @returns BN
- */
- function randomProbablePrime(bits: Integer, e: BN, k: Integer): any;
-
- /**
- * Probabilistic primality testing
- * @param n Number to test
- * @param e Optional RSA exponent to check against the prime
- * @param k Optional number of iterations of Miller-Rabin test
- * @returns
- */
- function isProbablePrime(n: BN, e: BN, k: Integer): boolean;
-
- /**
- * Tests whether n is probably prime or not using Fermat's test with b = 2.
- * Fails if b^(n-1) mod n === 1.
- * @param n Number to test
- * @param b Optional Fermat test base
- * @returns
- */
- function fermat(n: BN, b: Integer): boolean;
-
- /**
- * Tests whether n is probably prime or not using the Miller-Rabin test.
- * See HAC Remark 4.28.
- * @param n Number to test
- * @param k Optional number of iterations of Miller-Rabin test
- * @param rand Optional function to generate potential witnesses
- * @returns
- */
- function millerRabin(n: BN, k: Integer, rand: Function): boolean;
- }
-
- namespace rsa {
- /**
- * Create signature
- * @param m message
- * @param n RSA public modulus
- * @param e RSA public exponent
- * @param d RSA private exponent
- * @returns RSA Signature
- */
- function sign(m: BN, n: BN, e: BN, d: BN): BN;
-
- /**
- * Verify signature
- * @param s signature
- * @param n RSA public modulus
- * @param e RSA public exponent
- * @returns
- */
- function verify(s: BN, n: BN, e: BN): BN;
-
- /**
- * Encrypt message
- * @param m message
- * @param n RSA public modulus
- * @param e RSA public exponent
- * @returns RSA Ciphertext
- */
- function encrypt(m: BN, n: BN, e: BN): BN;
-
- /**
- * Decrypt RSA message
- * @param m message
- * @param n RSA public modulus
- * @param e RSA public exponent
- * @param d RSA private exponent
- * @param p RSA private prime p
- * @param q RSA private prime q
- * @param u RSA private inverse of prime q
- * @returns RSA Plaintext
- */
- function decrypt(m: BN, n: BN, e: BN, d: BN, p: BN, q: BN, u: BN): BN;
-
- /**
- * Generate a new random private key B bits long with public exponent E.
- * When possible, webCrypto is used. Otherwise, primes are generated using
- * 40 rounds of the Miller-Rabin probabilistic random prime generation algorithm.
- * @see module:crypto/public_key/prime
- * @param B RSA bit length
- * @param E RSA public exponent in hex string
- * @returns RSA public modulus, RSA public exponent, RSA private exponent,
- * RSA private prime p, RSA private prime q, u = q ** -1 mod p
- */
- function generate(B: Integer, E: string): object;
- }
- }
-
- namespace random {
- /**
- * Retrieve secure random byte array of the specified length
- * @param length Length in bytes to generate
- * @returns Random byte array
- */
- function getRandomBytes(length: Integer): Uint8Array;
-
- /**
- * Create a secure random MPI that is greater than or equal to min and less than max.
- * @param min Lower bound, included
- * @param max Upper bound, excluded
- * @returns Random MPI
- */
- function getRandomBN(min: type.mpi.MPI, max: type.mpi.MPI): BN;
-
- /**
- * Buffer for secure random numbers
- */
- function RandomBuffer(): void;
- }
-
- namespace signature {
- /**
- * Verifies the signature provided for data using specified algorithms and public key parameters.
- * See {@link https://tools.ietf.org/html/rfc4880#section-9.1|RFC 4880 9.1}
- * and {@link https://tools.ietf.org/html/rfc4880#section-9.4|RFC 4880 9.4}
- * for public key and hash algorithms.
- * @param algo Public key algorithm
- * @param hash_algo Hash algorithm
- * @param msg_MPIs Algorithm-specific signature parameters
- * @param pub_MPIs Algorithm-specific public key parameters
- * @param data Data for which the signature was created
- * @param hashed The hashed data
- * @returns True if signature is valid
- */
- function verify(
- algo: enums.publicKey,
- hash_algo: enums.hash,
- msg_MPIs: type.mpi.MPI[],
- pub_MPIs: type.mpi.MPI[],
- data: Uint8Array,
- hashed: Uint8Array,
- ): boolean;
-
- /**
- * Creates a signature on data using specified algorithms and private key parameters.
- * See {@link https://tools.ietf.org/html/rfc4880#section-9.1|RFC 4880 9.1}
- * and {@link https://tools.ietf.org/html/rfc4880#section-9.4|RFC 4880 9.4}
- * for public key and hash algorithms.
- * @param algo Public key algorithm
- * @param hash_algo Hash algorithm
- * @param key_params Algorithm-specific public and private key parameters
- * @param data Data to be signed
- * @param hashed The hashed data
- * @returns Signature
- */
- function sign(
- algo: enums.publicKey,
- hash_algo: enums.hash,
- key_params: type.mpi.MPI[],
- data: Uint8Array,
- hashed: Uint8Array,
- ): Uint8Array;
- }
-}
-
-export namespace eme {
- /**
- * Create a EME-PKCS1-v1_5 padded message
- * @see
- * @param M message to be encoded
- * @param k the length in octets of the key modulus
- * @returns EME-PKCS1 padded message
- */
- function encode(M: string, k: Integer): Promise;
-
- /**
- * Decode a EME-PKCS1-v1_5 padded message
- * @see
- * @param EM encoded message, an octet string
- * @returns message, an octet string
- */
- function decode(EM: string): string;
-}
-
-export namespace emsa {
- /**
- * Create a EMSA-PKCS1-v1_5 padded message
- * @see
- * @param algo Hash algorithm type used
- * @param hashed message to be encoded
- * @param emLen intended length in octets of the encoded message
- * @returns encoded message
- */
- function encode(algo: Integer, hashed: Uint8Array, emLen: Integer): string;
-}
-
-export namespace encoding {
- namespace armor {
- /**
- * Add additional information to the armor version of an OpenPGP binary
- * packet block.
- * @version 2011-12-16
- * @param customComment (optional) additional comment to add to the armored string
- * @returns The header information
- */
- function addheader(customComment: string): string;
-
- /**
- * Calculates a checksum over the given data and returns it base64 encoded
- * @param data Data to create a CRC-24 checksum for
- * @returns Base64 encoded checksum
- */
- function getCheckSum(data: string | ReadableStream): string | ReadableStream;
-
- /**
- * Internal function to calculate a CRC-24 checksum over a given string (data)
- * @param data Data to create a CRC-24 checksum for
- * @returns The CRC-24 checksum
- */
- function createcrc24(data: string | ReadableStream): Uint8Array | ReadableStream;
-
- /**
- * Splits a message into two parts, the body and the checksum. This is an internal function
- * @param text OpenPGP armored message part
- * @returns An object with attribute "body" containing the body
- * and an attribute "checksum" containing the checksum.
- */
- function splitChecksum(text: string): object;
-
- /**
- * DeArmor an OpenPGP armored message; verify the checksum and return
- * the encoded bytes
- * @param text OpenPGP armored message
- * @returns An object with attribute "text" containing the message text,
- * an attribute "data" containing a stream of bytes and "type" for the ASCII armor type
- */
- function dearmor(text: string): Promise