Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@destyler/shared

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@destyler/shared - npm Package Compare versions

Comparing version 0.0.1-beta.6 to 0.0.1-beta.7

206

dist/index.d.ts

@@ -1,67 +0,16 @@

import * as vue from 'vue';
import { PropType, Slots, VNode, Slot, VNodeArrayChildren, VNodeChild, Ref, InjectionKey, ExtractPropTypes } from 'vue';
import { Ref, ComponentPublicInstance, VNode, WatchOptionsBase, ComputedRef, WritableComputedRef, WatchSource, ComputedGetter, WritableComputedOptions } from 'vue';
declare const _default$1: vue.DefineComponent<{
appear: PropType<boolean>;
group: PropType<boolean>;
mode: PropType<"in-out" | "out-in" | "default">;
onLeave: FunctionConstructor;
onAfterLeave: FunctionConstructor;
onAfterEnter: FunctionConstructor;
width: PropType<boolean>;
reverse: PropType<boolean>;
}, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
[key: string]: any;
}>, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<vue.ExtractPropTypes<{
appear: PropType<boolean>;
group: PropType<boolean>;
mode: PropType<"in-out" | "out-in" | "default">;
onLeave: FunctionConstructor;
onAfterLeave: FunctionConstructor;
onAfterEnter: FunctionConstructor;
width: PropType<boolean>;
reverse: PropType<boolean>;
}>>, {}, {}>;
declare const isNumber: (v: any) => v is number;
declare const _default: vue.DefineComponent<{}, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
[key: string]: any;
}>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<vue.ExtractPropTypes<{}>>, {}, {}>;
/**
* Checks whether a given VNode is a render-vialble element.
*/
declare function isValidVNodeElement(input: any): boolean;
declare function beforeNextFrameOnce(cb: () => void): void;
declare function beforeNextFrameOnce<T1>(cb: (arg1: T1) => void, arg1: T1): void;
declare function beforeNextFrameOnce<T1, T2>(cb: (arg1: T1, arg2: T2) => void, arg1: T1, arg2: T2): void;
declare function beforeNextFrameOnce<T1, T2, T3>(cb: (arg1: T1, arg2: T2, arg3: T3) => void, arg1: T1, arg2: T2, arg3: T3): void;
declare function beforeNextFrameOnce<T1, T2, T3, T4>(cb: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => void, arg1: T1, arg2: T2, arg3: T3, arg4: T4): void;
declare function beforeNextFrameOnce<T extends any[]>(cb: (...args: T) => void, ...params: T): void;
declare const isClient: boolean;
declare function beforeNextFrame(cb: () => void): void;
declare function beforeNextFrame<T1>(cb: (arg1: T1) => void, arg1: T1): void;
declare function beforeNextFrame<T1, T2>(cb: (arg1: T1, arg2: T2) => void, arg1: T1, arg2: T2): void;
declare function beforeNextFrame<T1, T2, T3>(cb: (arg1: T1, arg2: T2, arg3: T3) => void, arg1: T1, arg2: T2, arg3: T3): void;
declare function beforeNextFrame<T1, T2, T3, T4>(cb: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => void, arg1: T1, arg2: T2, arg3: T3, arg4: T4): void;
declare function beforeNextFrame<T extends any[]>(cb: (...args: T) => void, ...args: T): void;
declare function handleAndDispatchCustomEvent<E extends CustomEvent, OriginalEvent extends Event>(name: string, handler: ((event: E) => void) | undefined, detail: {
originalEvent: OriginalEvent;
} & (E extends CustomEvent<infer D> ? D : never)): void;
interface TrapEventMap {
'mousemoveoutside': MouseEvent;
'clickoutside': MouseEvent;
}
interface EventListenerOptions {
capture?: boolean;
once?: boolean;
}
declare const on: (<K extends keyof HTMLElementEventMap>(type: K, el: HTMLElement, handler: (e: HTMLElementEventMap[K]) => any, useCapture?: boolean) => void) & (<K_1 extends keyof HTMLElementEventMap>(type: K_1, el: HTMLElement, handler: (e: HTMLElementEventMap[K_1]) => any, options?: EventListenerOptions) => void) & (<K_2 extends keyof WindowEventMap>(type: K_2, el: Window, handler: (e: WindowEventMap[K_2]) => any, useCapture?: boolean) => void) & (<K_3 extends keyof WindowEventMap>(type: K_3, el: Window, handler: (e: WindowEventMap[K_3]) => any, options?: EventListenerOptions) => void) & (<K_4 extends keyof DocumentEventMap>(type: K_4, el: Document, handler: (e: DocumentEventMap[K_4]) => any, useCapture?: boolean) => void) & (<K_5 extends keyof DocumentEventMap>(type: K_5, el: Document, handler: (e: DocumentEventMap[K_5]) => any, options?: EventListenerOptions) => void) & (<K_6 extends keyof TrapEventMap>(type: K_6, el: HTMLElement, handler: (e: TrapEventMap[K_6]) => any, useCapture?: boolean) => void) & (<K_7 extends keyof TrapEventMap>(type: K_7, el: HTMLElement, handler: (e: TrapEventMap[K_7]) => any, options?: EventListenerOptions) => void) & ((type: string, el: EventTarget, handler: EventListener, useCapture?: boolean) => void) & ((type: string, el: EventTarget, handler: EventListener, useCapture?: boolean) => void) & ((type: string, el: EventTarget, handler: EventListener, options?: EventListenerOptions) => void);
declare const off: (<K extends keyof HTMLElementEventMap>(type: K, el: HTMLElement, handler: (e: HTMLElementEventMap[K]) => any, useCapture?: boolean) => void) & (<K_1 extends keyof HTMLElementEventMap>(type: K_1, el: HTMLElement, handler: (e: HTMLElementEventMap[K_1]) => any, options?: EventListenerOptions) => void) & (<K_2 extends keyof WindowEventMap>(type: K_2, el: Window, handler: (e: WindowEventMap[K_2]) => any, useCapture?: boolean) => void) & (<K_3 extends keyof WindowEventMap>(type: K_3, el: Window, handler: (e: WindowEventMap[K_3]) => any, options?: EventListenerOptions) => void) & (<K_4 extends keyof DocumentEventMap>(type: K_4, el: Document, handler: (e: DocumentEventMap[K_4]) => any, useCapture?: boolean) => void) & (<K_5 extends keyof DocumentEventMap>(type: K_5, el: Document, handler: (e: DocumentEventMap[K_5]) => any, options?: EventListenerOptions) => void) & (<K_6 extends keyof TrapEventMap>(type: K_6, el: HTMLElement, handler: (e: TrapEventMap[K_6]) => any, useCapture?: boolean) => void) & (<K_7 extends keyof TrapEventMap>(type: K_7, el: HTMLElement, handler: (e: TrapEventMap[K_7]) => any, options?: EventListenerOptions) => void) & ((type: string, el: EventTarget, handler: EventListener, useCapture?: boolean) => void) & ((type: string, el: EventTarget, handler: EventListener, options?: EventListenerOptions) => void);
declare function getSlot(scope: string, slots: Slots, slotName?: string): VNode[];
declare function getFirstVNode(scope: string, slots: Slots, slotName?: string): VNode;
declare function isDocument(node: Node): node is Document;
declare function getPreciseEventTarget(event: Event): EventTarget | null;
declare function resolveTo(selector: string | (() => HTMLElement | null)): HTMLElement | null;
declare function isJsdom(): boolean;
type GetElement = () => HTMLElement;

@@ -72,58 +21,111 @@ declare function unwrapElement<T>(target: T | string | GetElement): T extends HTMLElement ? HTMLElement : HTMLElement | null;

declare function call(funcs: MaybeArray<() => void>): void;
declare function call<A1>(funcs: MaybeArray<(a1: A1) => void>, a1: A1): void;
declare function call<A1, A2>(funcs: MaybeArray<(a1: A1, a2: A2) => void>, a1: A1, a2: A2): void;
declare function call<A1, A2, A3>(funcs: MaybeArray<(a1: A1, a2: A2, a3: A3) => void>, a1: A1, a2: A2, a3: A3): void;
declare function call<A1, A2, A3, A4>(funcs: MaybeArray<(a1: A1, a2: A2, a3: A3, a4: A4) => void>, a1: A1, a2: A2, a3: A3, a4: A4): void;
declare function isDocument(node: Node): node is Document;
type MaybeArray<T> = T | T[];
/**
* There are situations where context can come from multiple components. In such cases, you might need to give an array of component names to provide your context, instead of just a single string.
* @param providerComponentName - The name(s) of the component(s) providing the context.
* @param contextName The description for injection key symbol.
*/
declare function createContext<ContextValue>(providerComponentName: string | string[], contextName?: string): readonly [<T extends ContextValue | null | undefined = ContextValue>(fallback?: T | undefined) => T extends null ? ContextValue | null : ContextValue, (contextValue: ContextValue) => ContextValue];
declare const isChrome: boolean;
declare const isFirefox: boolean;
declare const isSafari: boolean;
type Fn = () => void;
/**
* Any function
*/
type AnyFn = (...args: any[]) => any;
/**
* Maybe it's a ref, or a plain value
*
* ```ts
* type MaybeRef<T> = T | Ref<T>
* ```
*/
type MaybeRef<T> = T | Ref<T>;
/**
* Maybe it's a ref, or a plain value, or a getter function
*
* ```ts
* type MaybeRefOrGetter<T> = (() => T) | T | Ref<T> | ComputedRef<T>
* ```
*/
type MaybeRefOrGetter<T> = MaybeRef<T> | (() => T);
interface Stoppable<StartFnArgs extends any[] = any[]> {
/**
* A ref indicate whether a stoppable instance is executing
*/
isPending: Readonly<Ref<boolean>>;
/**
* Stop the effect from executing
*/
stop: Fn;
/**
* Start the effects
*/
start: (...args: StartFnArgs) => void;
}
declare const isBrowser: boolean;
/**
* We shouldn't use the following functions with slot flags `_: 1, 2, 3`
* Get the value of value/ref/getter.
*/
declare function resolveSlot(slot: Slot | undefined, fallback: () => VNodeArrayChildren): VNodeArrayChildren;
declare function resolveSlotWithProps<T>(slot: Slot | undefined, props: T, fallback: (props: T) => VNodeArrayChildren): VNodeArrayChildren;
declare function toValue<T>(r: MaybeRefOrGetter<T>): T;
/**
* Resolve slot with wrapper if content exists, no fallback
* @deprecated use `toValue` instead
*/
declare function resolveWrappedSlot(slot: Slot | undefined, wrapper: (children: VNodeArrayChildren | null) => VNodeChild): VNodeChild;
declare function resolveWrappedSlotWithProps(slot: Slot | undefined, props: any, wrapper: (children: VNodeArrayChildren | null) => VNodeChild): VNodeChild;
declare function isSlotEmpty(slot: Slot | undefined): boolean;
declare const resolveUnref: typeof toValue;
declare const isImageSupportNativeLazy: boolean;
declare const isDef: <T = any>(val?: T | undefined) => val is T;
type IntersectionObserverOptions = Omit<IntersectionObserverInit, 'root'> & {
root?: Element | Document | null | string;
};
declare function resolveOptionsAndHash(options?: IntersectionObserverOptions | undefined): {
hash: string;
options: Omit<IntersectionObserverInit, 'root'> & {
root: Element | Document;
};
};
declare const observeIntersection: (el: HTMLElement | null, options: IntersectionObserverOptions | undefined, shouldStartLoadingRef: Ref<boolean>) => () => void;
/**
* Keep states in the global scope to be reusable across Vue instances.
*
* @param stateFactory A factory function to create the state
*/
declare function createGlobalState<Fn extends AnyFn>(stateFactory: Fn): Fn;
declare function createInjectionKey<T>(key: string): InjectionKey<T>;
type VueInstance = ComponentPublicInstance;
type MaybeElementRef<T extends MaybeElement = MaybeElement> = MaybeRef<T>;
type MaybeComputedElementRef<T extends MaybeElement = MaybeElement> = MaybeRefOrGetter<T>;
type MaybeElement = HTMLElement | SVGElement | VueInstance | undefined | null;
type UnRefElementReturn<T extends MaybeElement = MaybeElement> = T extends VueInstance ? Exclude<MaybeElement, VueInstance> : T | undefined;
/**
* Get the dom element of a ref of element or Vue component instance
*
* @param elRef
*/
declare function unrefElement<T extends MaybeElement>(elRef: MaybeComputedElementRef<T>): UnRefElementReturn<T>;
declare function createId(length?: number): string;
declare function sleep(ms: number): Promise<void>;
declare function renderSlotFragments(children?: VNode[]): VNode[];
declare function flatten(vNodes: VNodeChild[], filterCommentNode?: boolean, result?: VNode[]): VNode[];
/**
* @param fn effect function
* @param options WatchOptionsBase
* @returns readonly ref
*/
declare function computedEager<T>(fn: () => T, options?: WatchOptionsBase): Readonly<Ref<T>>;
declare function getFirstSlotVNode(slots: Slots, slotName?: string, props?: unknown): VNode | null;
interface ComputedWithControlRefExtra {
/**
* Force update the computed value.
*/
trigger(): void;
}
interface ComputedRefWithControl<T> extends ComputedRef<T>, ComputedWithControlRefExtra {
}
interface WritableComputedRefWithControl<T> extends WritableComputedRef<T>, ComputedWithControlRefExtra {
}
declare function computedWithControl<T, S>(source: WatchSource<S> | WatchSource<S>[], fn: ComputedGetter<T>): ComputedRefWithControl<T>;
declare function computedWithControl<T, S>(source: WatchSource<S> | WatchSource<S>[], fn: WritableComputedOptions<T>): WritableComputedRefWithControl<T>;
declare function keep<T, K, R>(object: T, keys?: K[], rest?: R): Pick<T, K & keyof T> & R;
/**
* Call onScopeDispose() if it's inside an effect scope lifecycle, if not, do nothing
*
* @param fn
*/
declare function tryOnScopeDispose(fn: Fn): boolean;
type RemoveReadonly<T> = {
-readonly [key in keyof T]: T[key];
};
type ExtractPublicPropTypes<T> = Omit<Partial<RemoveReadonly<ExtractPropTypes<T>>>, Extract<keyof T, `internal${string}`>>;
type ExtractInternalPropTypes<T> = Partial<ExtractPropTypes<T>>;
type DataOrientation = 'vertical' | 'horizontal';
type Direction = 'ltr' | 'rtl';
type Type = 'single' | 'multiple';
type ArrowKeyOptions = 'horizontal' | 'vertical' | 'both';
export { _default as BaseIconSwitchTransition, type ExtractInternalPropTypes, type ExtractPublicPropTypes, _default$1 as FadeInExpandTransition, type IntersectionObserverOptions, type MaybeArray, beforeNextFrame, beforeNextFrameOnce, call, createId, createInjectionKey, flatten, getFirstSlotVNode, getFirstVNode, getPreciseEventTarget, getScrollParent, getSlot, isBrowser, isChrome, isDocument, isFirefox, isImageSupportNativeLazy, isJsdom, isSafari, isSlotEmpty, keep, observeIntersection, off, on, resolveOptionsAndHash, resolveSlot, resolveSlotWithProps, resolveTo, resolveWrappedSlot, resolveWrappedSlotWithProps, sleep, unwrapElement };
export { type AnyFn, type ArrowKeyOptions, type ComputedRefWithControl, type ComputedWithControlRefExtra, type DataOrientation, type Direction, type Fn, type MaybeComputedElementRef, type MaybeElement, type MaybeElementRef, type MaybeRef, type MaybeRefOrGetter, type Stoppable, type Type, type UnRefElementReturn, type VueInstance, type WritableComputedRefWithControl, computedEager, computedWithControl, computedWithControl as controlledComputed, createContext, createGlobalState, computedEager as eagerComputed, getScrollParent, handleAndDispatchCustomEvent, isClient, isDef, isDocument, isNumber, isValidVNodeElement, renderSlotFragments, resolveUnref, toValue, tryOnScopeDispose, unrefElement, unwrapElement };
{
"name": "@destyler/shared",
"version": "0.0.1-beta.6",
"version": "0.0.1-beta.7",
"description": "",

@@ -25,5 +25,2 @@ "author": "Elone Hoo <elonehoo@gmail.com>",

},
"dependencies": {
"@destyler/composition": "0.0.1-beta.6"
},
"scripts": {

@@ -30,0 +27,0 @@ "clear": "rimraf ./dist",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc