From 0eb293730641bc6720ae8c3cfada66325f8cbb93 Mon Sep 17 00:00:00 2001 From: "Vitaliy V. Makeev" Date: Fri, 29 Jul 2022 11:53:30 +0500 Subject: [PATCH] feat(types): export helpers type --- src/types.ts | 4 ++++ tests/types/commom.ts | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/types.ts b/src/types.ts index 1773036..2fdae58 100644 --- a/src/types.ts +++ b/src/types.ts @@ -6,6 +6,8 @@ import { RemapApiHref } from 'moysklad-api-model' +import { getHelpers } from './index' + export interface Meta { type: T href: string @@ -95,3 +97,5 @@ export type HrefMetaType = ? 'pricetype' : never + +export type Helpers = ReturnType diff --git a/tests/types/commom.ts b/tests/types/commom.ts index 889f460..a8adde9 100644 --- a/tests/types/commom.ts +++ b/tests/types/commom.ts @@ -1,6 +1,6 @@ import Moysklad from 'moysklad' import { EntityRef, Patch } from 'moysklad-api-model' -import { getHelpers } from '../../src' +import { getHelpers, Helpers } from '../../src' import { noop, testTypeEqual } from '../tools' const ms = Moysklad() @@ -15,3 +15,7 @@ const orderPatch: Patch<'customerorder'> = { testTypeEqual>(ref('foo')) noop(orderPatch) + +const helpers = {} as Helpers + +helpers.href('entity/customerorder')