From: Eduardo San Martin Morote Date: Mon, 31 Jan 2022 13:17:00 +0000 (+0100) Subject: refactor: export internal types X-Git-Tag: @pinia/testing@0.0.10~41 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=30e48b626aa744f7a23cd4dc6df21c5f18e87a9c;p=thirdparty%2Fvuejs%2Fpinia.git refactor: export internal types --- diff --git a/packages/pinia/api-extractor.json b/packages/pinia/api-extractor.json index 9d27602f..d3486484 100644 --- a/packages/pinia/api-extractor.json +++ b/packages/pinia/api-extractor.json @@ -36,12 +36,19 @@ "ae-missing-release-tag": { "logLevel": "none" + }, + + "ae-incompatible-release-tags": { + "logLevel": "none" } }, "tsdocMessageReporting": { "default": { "logLevel": "warning" + }, + "tsdoc-code-span-missing-delimiter": { + "logLevel": "none" } } } diff --git a/packages/pinia/src/index.ts b/packages/pinia/src/index.ts index 58b1f4a7..9735ef37 100644 --- a/packages/pinia/src/index.ts +++ b/packages/pinia/src/index.ts @@ -49,6 +49,7 @@ export type { _ExtractGettersFromSetupStore_Keys, _ExtractStateFromSetupStore_Keys, _UnwrapAll, + _Awaited, } from './types' export { MutationType } from './types' diff --git a/packages/pinia/src/types.ts b/packages/pinia/src/types.ts index 0f8c8c85..78983cb0 100644 --- a/packages/pinia/src/types.ts +++ b/packages/pinia/src/types.ts @@ -161,7 +161,7 @@ export type SubscriptionCallback = ( // to support TS 4.4 // TODO: remove in 2.1.0, use Awaited, and up the peer dep to TS 4.5 -type _Awaited = T extends null | undefined +export type _Awaited = T extends null | undefined ? T // special case for `null | undefined` when not in `--strictNullChecks` mode : T extends object & { then(onfulfilled: infer F): any } // `await` only unwraps object types with a callable `then`. Non-object types are not unwrapped ? F extends (value: infer V, ...args: any) => any // if the argument to `then` is callable, extracts the first argument