index.d.mts 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  1. import * as vue from 'vue';
  2. import { Ref, DeepReadonly, ComponentPropsOptions, ExtractPropTypes } from 'vue';
  3. interface InternalThemeDefinition {
  4. dark: boolean;
  5. colors: Colors;
  6. variables: Record<string, string | number>;
  7. }
  8. interface Colors extends BaseColors, OnColors {
  9. [key: string]: string;
  10. }
  11. interface BaseColors {
  12. background: string;
  13. surface: string;
  14. primary: string;
  15. secondary: string;
  16. success: string;
  17. warning: string;
  18. error: string;
  19. info: string;
  20. }
  21. interface OnColors {
  22. 'on-background': string;
  23. 'on-surface': string;
  24. 'on-primary': string;
  25. 'on-secondary': string;
  26. 'on-success': string;
  27. 'on-warning': string;
  28. 'on-error': string;
  29. 'on-info': string;
  30. }
  31. interface ThemeInstance {
  32. readonly isDisabled: boolean;
  33. readonly themes: Ref<Record<string, InternalThemeDefinition>>;
  34. readonly name: Readonly<Ref<string>>;
  35. readonly current: DeepReadonly<Ref<InternalThemeDefinition>>;
  36. readonly computedThemes: DeepReadonly<Ref<Record<string, InternalThemeDefinition>>>;
  37. readonly themeClasses: Readonly<Ref<string | undefined>>;
  38. readonly styles: Readonly<Ref<string>>;
  39. readonly global: {
  40. readonly name: Ref<string>;
  41. readonly current: DeepReadonly<Ref<InternalThemeDefinition>>;
  42. };
  43. }
  44. interface FilterPropsOptions<PropsOptions extends Readonly<ComponentPropsOptions>, Props = ExtractPropTypes<PropsOptions>> {
  45. filterProps<T extends Partial<Props>, U extends Exclude<keyof Props, Exclude<keyof Props, keyof T>>>(props: T): Partial<Pick<T, U>>;
  46. }
  47. type ClassValue = any;
  48. type Position = 'top' | 'left' | 'right' | 'bottom';
  49. declare const VApp: {
  50. new (...args: any[]): vue.CreateComponentPublicInstance<{
  51. style: vue.StyleValue;
  52. fullHeight: boolean;
  53. } & {
  54. class?: any;
  55. theme?: string | undefined;
  56. overlaps?: string[] | undefined;
  57. } & {
  58. $children?: vue.VNodeChild | {
  59. default?: (() => vue.VNodeChild) | undefined;
  60. } | (() => vue.VNodeChild);
  61. 'v-slots'?: {
  62. default?: false | (() => vue.VNodeChild) | undefined;
  63. } | undefined;
  64. } & {
  65. "v-slot:default"?: false | (() => vue.VNodeChild) | undefined;
  66. }, {
  67. getLayoutItem: (id: string) => {
  68. size: number;
  69. position: Position;
  70. top: number;
  71. bottom: number;
  72. left: number;
  73. right: number;
  74. id: string;
  75. } | undefined;
  76. items: vue.ComputedRef<{
  77. size: number;
  78. position: Position;
  79. top: number;
  80. bottom: number;
  81. left: number;
  82. right: number;
  83. id: string;
  84. }[]>;
  85. theme: ThemeInstance;
  86. }, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, Record<string, any>, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps & {
  87. style: vue.StyleValue;
  88. fullHeight: boolean;
  89. } & {
  90. class?: any;
  91. theme?: string | undefined;
  92. overlaps?: string[] | undefined;
  93. } & {
  94. $children?: vue.VNodeChild | {
  95. default?: (() => vue.VNodeChild) | undefined;
  96. } | (() => vue.VNodeChild);
  97. 'v-slots'?: {
  98. default?: false | (() => vue.VNodeChild) | undefined;
  99. } | undefined;
  100. } & {
  101. "v-slot:default"?: false | (() => vue.VNodeChild) | undefined;
  102. }, {
  103. style: vue.StyleValue;
  104. fullHeight: boolean;
  105. }, true, {}, vue.SlotsType<Partial<{
  106. default: () => vue.VNode[];
  107. }>>, {
  108. P: {};
  109. B: {};
  110. D: {};
  111. C: {};
  112. M: {};
  113. Defaults: {};
  114. }, {
  115. style: vue.StyleValue;
  116. fullHeight: boolean;
  117. } & {
  118. class?: any;
  119. theme?: string | undefined;
  120. overlaps?: string[] | undefined;
  121. } & {
  122. $children?: vue.VNodeChild | {
  123. default?: (() => vue.VNodeChild) | undefined;
  124. } | (() => vue.VNodeChild);
  125. 'v-slots'?: {
  126. default?: false | (() => vue.VNodeChild) | undefined;
  127. } | undefined;
  128. } & {
  129. "v-slot:default"?: false | (() => vue.VNodeChild) | undefined;
  130. }, {
  131. getLayoutItem: (id: string) => {
  132. size: number;
  133. position: Position;
  134. top: number;
  135. bottom: number;
  136. left: number;
  137. right: number;
  138. id: string;
  139. } | undefined;
  140. items: vue.ComputedRef<{
  141. size: number;
  142. position: Position;
  143. top: number;
  144. bottom: number;
  145. left: number;
  146. right: number;
  147. id: string;
  148. }[]>;
  149. theme: ThemeInstance;
  150. }, {}, {}, {}, {
  151. style: vue.StyleValue;
  152. fullHeight: boolean;
  153. }>;
  154. __isFragment?: never;
  155. __isTeleport?: never;
  156. __isSuspense?: never;
  157. } & vue.ComponentOptionsBase<{
  158. style: vue.StyleValue;
  159. fullHeight: boolean;
  160. } & {
  161. class?: any;
  162. theme?: string | undefined;
  163. overlaps?: string[] | undefined;
  164. } & {
  165. $children?: vue.VNodeChild | {
  166. default?: (() => vue.VNodeChild) | undefined;
  167. } | (() => vue.VNodeChild);
  168. 'v-slots'?: {
  169. default?: false | (() => vue.VNodeChild) | undefined;
  170. } | undefined;
  171. } & {
  172. "v-slot:default"?: false | (() => vue.VNodeChild) | undefined;
  173. }, {
  174. getLayoutItem: (id: string) => {
  175. size: number;
  176. position: Position;
  177. top: number;
  178. bottom: number;
  179. left: number;
  180. right: number;
  181. id: string;
  182. } | undefined;
  183. items: vue.ComputedRef<{
  184. size: number;
  185. position: Position;
  186. top: number;
  187. bottom: number;
  188. left: number;
  189. right: number;
  190. id: string;
  191. }[]>;
  192. theme: ThemeInstance;
  193. }, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, Record<string, any>, string, {
  194. style: vue.StyleValue;
  195. fullHeight: boolean;
  196. }, {}, string, vue.SlotsType<Partial<{
  197. default: () => vue.VNode[];
  198. }>>> & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps & FilterPropsOptions<{
  199. theme: StringConstructor;
  200. overlaps: vue.Prop<string[]>;
  201. fullHeight: {
  202. type: vue.PropType<boolean>;
  203. default: boolean;
  204. };
  205. class: vue.PropType<ClassValue>;
  206. style: {
  207. type: vue.PropType<vue.StyleValue>;
  208. default: null;
  209. };
  210. }, vue.ExtractPropTypes<{
  211. theme: StringConstructor;
  212. overlaps: vue.Prop<string[]>;
  213. fullHeight: {
  214. type: vue.PropType<boolean>;
  215. default: boolean;
  216. };
  217. class: vue.PropType<ClassValue>;
  218. style: {
  219. type: vue.PropType<vue.StyleValue>;
  220. default: null;
  221. };
  222. }>>;
  223. type VApp = InstanceType<typeof VApp>;
  224. export { VApp };