1
import { QUploader, LiteralUnion } from "quasar";
5
ComponentPublicInstance,
12
import { MetaOptions } from "./meta";
14
export * from "./utils/colors";
15
export * from "./utils/date";
16
export * from "./utils/dom";
17
export * from "./utils/event";
18
export * from "./utils/format";
19
export * from "./utils/scroll";
20
export * from "./utils/is";
21
export * from "./utils/patterns";
22
export * from "./utils/run-sequential-promises";
24
import { BrandColor } from "./api/color";
25
import { VueStyleObjectProp } from "./api/vue-prop-types";
27
interface ExportFileOpts {
29
byteOrderMark?: string | Uint8Array;
34
export function copyToClipboard(text: string): Promise<void>;
36
export function debounce<F extends (...args: any[]) => any>(
40
): ((this: ThisParameterType<F>, ...args: Parameters<F>) => void) & {
44
export function frameDebounce<F extends (...args: any[]) => any>(
46
): ((this: ThisParameterType<F>, ...args: Parameters<F>) => void) & {
50
export function exportFile(
52
rawData: string | ArrayBuffer | ArrayBufferView | Blob,
53
opts?: string | ExportFileOpts,
56
export function extend<R>(deep: boolean, target: any, ...sources: any[]): R;
57
export function extend<R>(target: object, ...sources: any[]): R;
59
export function openURL<F extends (...args: any[]) => any>(
62
windowFeatures?: Object,
65
export function throttle<F extends (...args: any[]) => any>(
70
export function uid(): string;
72
interface MorphOptions {
73
from: Element | string | (() => Element | null | undefined);
74
to?: Element | string | (() => Element | null | undefined);
75
onToggle?: () => void;
76
waitFor?: number | "transitionend" | Promise<any>;
83
style?: string | VueStyleObjectProp;
88
hideFromClone?: boolean;
89
keepToClone?: boolean;
92
tweenFromOpacity?: number;
93
tweenToOpacity?: number;
95
onEnd?: (direction: "to" | "from", aborted: boolean) => void;
98
export function morph(options: MorphOptions): (abort?: boolean) => boolean;
100
export function getCssVar(
101
varName: LiteralUnion<BrandColor>,
105
export function setCssVar(
106
varName: LiteralUnion<BrandColor>,
112
[key: string]: (...args: any[]) => void;
115
export class EventBus<T extends Callbacks = Callbacks> {
116
on<K extends keyof T>(
119
...ctx: unknown extends ThisParameterType<T[K]>
121
: [ctx: ThisParameterType<T[K]>]
123
once<K extends keyof T>(
126
...ctx: unknown extends ThisParameterType<T[K]>
128
: [ctx: ThisParameterType<T[K]>]
130
emit<K extends keyof T>(event: K, ...args: Parameters<T[K]>): this;
131
off<K extends keyof T>(event: K, callback?: T[K]): this;
134
interface CreateMetaMixinContext extends ComponentPublicInstance {
135
[index: string]: any;
138
export function createMetaMixin<
139
CustomInstanceProperties extends Record<string, any> = {},
144
this: CreateMetaMixinContext & CustomInstanceProperties,
146
): ComponentOptionsMixin;
148
interface InjectPluginFnHelpers {
149
queuedFiles: Ref<File[]>;
150
uploadedFiles: Ref<File[]>;
151
uploadedSize: Ref<number>;
154
status: "failed" | "idle" | "uploaded" | "uploading",
155
uploadedSize?: number,
157
isAlive: () => boolean;
160
interface InjectPluginFnOptions<Props> {
161
props: ExtractPropTypes<Props>;
162
emit: SetupContext["emit"];
163
helpers: InjectPluginFnHelpers;
164
exposeApi: (api: Record<string, any>) => void;
167
interface InjectPluginFnReturn {
168
isUploading: Ref<boolean>;
169
isBusy: Ref<boolean>;
174
interface CreateUploaderComponentOptions<
175
Props extends ComponentPropsOptions = {},
176
Emits extends EmitsOptions = [],
181
injectPlugin(options: InjectPluginFnOptions<Props>): InjectPluginFnReturn;
184
export function createUploaderComponent<
185
Props extends ComponentPropsOptions = {},
186
Emits extends EmitsOptions = [],
188
options: CreateUploaderComponentOptions<Props, Emits>,
189
): QUploader & DefineComponent<Props, {}, {}, {}, {}, {}, {}, Emits>;