From b10bff95e9c8769fe5bc4ad449028939bcd49e2c Mon Sep 17 00:00:00 2001 From: K Date: Thu, 19 Oct 2023 13:03:10 +0000 Subject: [PATCH] Update types and set Zod globally --- src/index.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/index.ts b/src/index.ts index 7092629..d7a82c5 100644 --- a/src/index.ts +++ b/src/index.ts @@ -2,12 +2,12 @@ import { WarpPlugin, WarpPluginType } from 'warp-contracts'; import { z } from 'zod'; -declare global { - interface SmartWeave { - extensions: { - zod: typeof z; - }; - } +export type Zod = typeof z; + +export interface SmartweaveZodExtension { + extensions: { + z: Zod; + }; } export class ZodExtension implements WarpPlugin { @@ -16,6 +16,7 @@ export class ZodExtension implements WarpPlugin { } type(): WarpPluginType { + global.zod = z; return 'smartweave-extension-zod'; } }