Skip to content

Commit

Permalink
feat(types): export helpers type
Browse files Browse the repository at this point in the history
  • Loading branch information
wmakeev committed Jul 29, 2022
1 parent 08777eb commit 0eb2937
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import {
RemapApiHref
} from 'moysklad-api-model'

import { getHelpers } from './index'

export interface Meta<T extends string = string> {
type: T
href: string
Expand Down Expand Up @@ -95,3 +97,5 @@ export type HrefMetaType<Ref extends string> =
? 'pricetype'

: never

export type Helpers = ReturnType<typeof getHelpers>
6 changes: 5 additions & 1 deletion tests/types/commom.ts
Original file line number Diff line number Diff line change
@@ -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()
Expand All @@ -15,3 +15,7 @@ const orderPatch: Patch<'customerorder'> = {
testTypeEqual<EntityRef<'state'>>(ref('foo'))

noop(orderPatch)

const helpers = {} as Helpers

helpers.href('entity/customerorder')

0 comments on commit 0eb2937

Please sign in to comment.