From: Chris Duncan Date: Sun, 29 Jun 2025 07:35:17 +0000 (-0700) Subject: Move API support types to config file that uses it and remove redundant type. X-Git-Tag: v5.1.4~2 X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=547119917f23ea86421b562a76d0ebbb52beb7c8;p=nano-pow.git Move API support types to config file that uses it and remove redundant type. --- diff --git a/src/lib/config/index.ts b/src/lib/config/index.ts index 5eb7667..482b6dc 100644 --- a/src/lib/config/index.ts +++ b/src/lib/config/index.ts @@ -1,9 +1,11 @@ //! SPDX-FileCopyrightText: 2025 Chris Duncan //! SPDX-License-Identifier: GPL-3.0-or-later -import { ApiSupportedTypes, NanoPowOptions } from '#types' +import { NanoPowOptions } from '#types' import { ApiSupport, bigintFrom, bigintToHex, SEND } from '#utils' +type ApiSupportedTypes = keyof typeof ApiSupport + class NanoPowConfigConstructor implements NanoPowOptions { static #isInternal: boolean = false api: ApiSupportedTypes diff --git a/src/types.d.ts b/src/types.d.ts index 6f039cd..cc6e50f 100644 --- a/src/types.d.ts +++ b/src/types.d.ts @@ -7,20 +7,6 @@ declare global { } } -export declare const ApiSupported: { - cpu: boolean - wasm: { - isSupported: boolean - } - webgl: { - isSupported: boolean - } - webgpu: { - isSupported: boolean - } -} -export type ApiSupportedTypes = keyof typeof ApiSupported - export declare class NanoPow { /** * Finds a nonce that satisfies the Nano proof-of-work requirements.