UNPKG

vitepress-openapi

Version:

Generate VitePress API Documentation from OpenAPI Specification.

15 lines (14 loc) 540 B
/** * Inspired by https://github.com/DanHulton/vue-deepunref and converted to TypeScript */ import type { Ref } from 'vue'; type DeepUnrefArray<T> = Array<DeepUnref<T>>; type DeepUnrefObject<T> = { [K in keyof T]: DeepUnref<T[K]>; }; export type DeepUnref<T> = T extends Ref<infer V> ? DeepUnref<V> : T extends Array<any> ? DeepUnrefArray<T[number]> : T extends object ? DeepUnrefObject<T> : T; /** * Deeply unref a value, recursing into objects and arrays. */ export declare function deepUnref<T>(val: T): DeepUnref<T>; export {};