Skip to content

Commit

Permalink
🤖 dprint fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
typescript-bot committed Jan 18, 2025
1 parent d52d9d9 commit b46ebd3
Show file tree
Hide file tree
Showing 11 changed files with 704 additions and 697 deletions.
44 changes: 22 additions & 22 deletions types/phoenix_live_view/hooks.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,33 @@ export type OnReply = (reply: any, ref: number) => any;
export type CallbackRef = (customEvent: any, bypass: boolean) => string;

export interface ViewHookInterface {
el: HTMLElement;
liveSocket: LiveSocket;
el: HTMLElement;
liveSocket: LiveSocket;

mounted?: () => void;
updated?: () => void;
beforeUpdate?: () => void;
destroyed?: () => void;
reconnected?: () => void;
disconnected?: () => void;
mounted?: () => void;
updated?: () => void;
beforeUpdate?: () => void;
destroyed?: () => void;
reconnected?: () => void;
disconnected?: () => void;

js(): object;
pushEvent(event: string, payload: any, onReply?: OnReply): any;
pushEventTo(phxTarget: any, event: string, payload: object, onReply?: OnReply): any;
handleEvent(event: string, callback: any): CallbackRef;
removeHandleEvent(callbackRef: CallbackRef): void;
upload(name: any, files: any): any;
uploadTo(phxTarget: any, name: any, files: any): any;
js(): object;
pushEvent(event: string, payload: any, onReply?: OnReply): any;
pushEventTo(phxTarget: any, event: string, payload: object, onReply?: OnReply): any;
handleEvent(event: string, callback: any): CallbackRef;
removeHandleEvent(callbackRef: CallbackRef): void;
upload(name: any, files: any): any;
uploadTo(phxTarget: any, name: any, files: any): any;
}

export interface Hook<T extends object = {}> {
mounted?: (this: T & ViewHookInterface) => void;
beforeUpdate?: (this: T & ViewHookInterface) => void;
updated?: (this: T & ViewHookInterface) => void;
beforeDestroy?: (this: T & ViewHookInterface) => void;
destroyed?: (this: T & ViewHookInterface) => void;
disconnected?: (this: T & ViewHookInterface) => void;
reconnected?: (this: T & ViewHookInterface) => void;
mounted?: (this: T & ViewHookInterface) => void;
beforeUpdate?: (this: T & ViewHookInterface) => void;
updated?: (this: T & ViewHookInterface) => void;
beforeDestroy?: (this: T & ViewHookInterface) => void;
destroyed?: (this: T & ViewHookInterface) => void;
disconnected?: (this: T & ViewHookInterface) => void;
reconnected?: (this: T & ViewHookInterface) => void;
}

export type HooksOptions = Record<string, Hook<any>>;
30 changes: 15 additions & 15 deletions types/phoenix_live_view/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,22 +54,22 @@ import ViewHook from "./view_hook";
export function createHook(el: HTMLElement, callbacks?: object): ViewHook;

export {
Defaults,
DomOptions,
EventMetadata,
Hook,
HooksOptions,
isUsedInput,
LiveSocket,
SocketOptions,
UploadEntry,
Uploader,
UploadersOptions,
ViewHookInterface,
Defaults,
DomOptions,
EventMetadata,
Hook,
HooksOptions,
isUsedInput,
LiveSocket,
SocketOptions,
UploadEntry,
Uploader,
UploadersOptions,
ViewHookInterface,
};

declare global {
interface Window {
liveSocket?: LiveSocket;
}
interface Window {
liveSocket?: LiveSocket;
}
}
236 changes: 118 additions & 118 deletions types/phoenix_live_view/live_socket.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,126 +2,126 @@ import SocketOptions from "./socket_options";

export function isUsedInput(el: any): any;
export default class LiveSocket {
constructor(url: any, phxSocket: any, opts: Partial<SocketOptions>);
unloaded: boolean;
socket: any;
bindingPrefix: any;
opts: any;
params: any;
viewLogger: any;
metadataCallbacks: any;
defaults: any;
activeElement: any;
prevActive: Element | null;
silenced: boolean;
main: View | null;
outgoingMainEl: any;
clickStartedAtTarget: any;
linkRef: number;
roots: any;
href: string;
pendingLink: any;
currentLocation: any;
hooks: any;
uploaders: any;
loaderTimeout: any;
reloadWithJitterTimer: number | null;
maxReloads: any;
reloadJitterMin: any;
reloadJitterMax: any;
failsafeJitter: any;
localStorage: any;
sessionStorage: any;
boundTopLevelEvents: boolean;
boundEventNames: Set<any>;
serverCloseRef: any;
domCallbacks: any;
transitions: TransitionSet;
currentHistoryPosition: number;
version(): any;
isProfileEnabled(): boolean;
isDebugEnabled(): boolean;
isDebugDisabled(): boolean;
enableDebug(): void;
enableProfiling(): void;
disableDebug(): void;
disableProfiling(): void;
enableLatencySim(upperBoundMs: any): void;
disableLatencySim(): void;
getLatencySim(): number | null;
getSocket(): any;
connect(): void;
disconnect(callback: any): void;
replaceTransport(transport: any): void;
execJS(el: HTMLElement, encodedJS: any, eventType?: string): void; // DT
execJSHookPush(el: HTMLElement, phxEvent: any, data: any, callback: any): void;
unload(): void;
triggerDOM(kind: any, args: any): void;
time(name: any, func: any): any;
log(view: any, kind: any, msgCallback: any): void;
requestDOMUpdate(callback: any): void;
transition(time: any, onStart: any, onDone?: () => void): void;
onChannel(channel: any, event: any, cb: any): void;
reloadWithJitter(view: any, log: any): void;
getHookCallbacks(name: any): any;
isUnloaded(): boolean;
isConnected(): any;
getBindingPrefix(): any;
binding(kind: any): string;
channel(topic: any, params: any): any;
joinDeadView(): void;
joinRootViews(): boolean;
redirect(to: any, flash: any, reloadToken: any): void;
replaceMain(href: any, flash: any, callback?: null, linkRef?: number): void;
transitionRemoves(elements: any, skipSticky: any, callback: any): void;
isPhxView(el: any): any;
newRootView(el: any, flash: any, liveReferer: any): View;
owner(childEl: any, callback: any): any;
withinOwners(childEl: any, callback: any): void;
getViewByEl(el: any): any;
getRootById(id: any): any;
destroyAllViews(): void;
destroyViewByEl(el: any): void;
getActiveElement(): Element | null;
dropActiveElement(view: any): void;
restorePreviouslyActiveFocus(): void;
blurActiveElement(): void;
bindTopLevelEvents(dead?: object): void; // DT
eventMeta(eventName: any, e: any, targetEl: any): any;
setPendingLink(href: any): number;
resetReloadStatus(): void;
commitPendingLink(linkRef: any): boolean;
getHref(): string;
hasPendingLink(): boolean;
bind(events: any, callback: any): void;
bindClicks(): void;
bindClick(eventName: any, bindingName: any): void;
dispatchClickAway(e: any, clickStartedAt: any): void;
bindNav(): void;
maybeScroll(scroll: any): void;
dispatchEvent(event: any, payload?: {}): void;
dispatchEvents(events: any): void;
withPageLoading(info: any, callback: any): any;
pushHistoryPatch(e: any, href: any, linkState: any, targetEl: any): void;
historyPatch(href: any, linkState: any, linkRef?: number): void;
historyRedirect(e: any, href: any, linkState: any, flash: any, targetEl: any): void;
replaceRootHistory(): void;
registerNewLocation(newLocation: any): boolean;
bindForms(): void;
debounce(el: any, event: any, eventType: any, callback: any): any;
silenceEvents(callback: any): void;
on(event: any, callback: any): void;
jsQuerySelectorAll(sourceEl: any, query: any, defaultQuery: any): any;
constructor(url: any, phxSocket: any, opts: Partial<SocketOptions>);
unloaded: boolean;
socket: any;
bindingPrefix: any;
opts: any;
params: any;
viewLogger: any;
metadataCallbacks: any;
defaults: any;
activeElement: any;
prevActive: Element | null;
silenced: boolean;
main: View | null;
outgoingMainEl: any;
clickStartedAtTarget: any;
linkRef: number;
roots: any;
href: string;
pendingLink: any;
currentLocation: any;
hooks: any;
uploaders: any;
loaderTimeout: any;
reloadWithJitterTimer: number | null;
maxReloads: any;
reloadJitterMin: any;
reloadJitterMax: any;
failsafeJitter: any;
localStorage: any;
sessionStorage: any;
boundTopLevelEvents: boolean;
boundEventNames: Set<any>;
serverCloseRef: any;
domCallbacks: any;
transitions: TransitionSet;
currentHistoryPosition: number;
version(): any;
isProfileEnabled(): boolean;
isDebugEnabled(): boolean;
isDebugDisabled(): boolean;
enableDebug(): void;
enableProfiling(): void;
disableDebug(): void;
disableProfiling(): void;
enableLatencySim(upperBoundMs: any): void;
disableLatencySim(): void;
getLatencySim(): number | null;
getSocket(): any;
connect(): void;
disconnect(callback: any): void;
replaceTransport(transport: any): void;
execJS(el: HTMLElement, encodedJS: any, eventType?: string): void; // DT
execJSHookPush(el: HTMLElement, phxEvent: any, data: any, callback: any): void;
unload(): void;
triggerDOM(kind: any, args: any): void;
time(name: any, func: any): any;
log(view: any, kind: any, msgCallback: any): void;
requestDOMUpdate(callback: any): void;
transition(time: any, onStart: any, onDone?: () => void): void;
onChannel(channel: any, event: any, cb: any): void;
reloadWithJitter(view: any, log: any): void;
getHookCallbacks(name: any): any;
isUnloaded(): boolean;
isConnected(): any;
getBindingPrefix(): any;
binding(kind: any): string;
channel(topic: any, params: any): any;
joinDeadView(): void;
joinRootViews(): boolean;
redirect(to: any, flash: any, reloadToken: any): void;
replaceMain(href: any, flash: any, callback?: null, linkRef?: number): void;
transitionRemoves(elements: any, skipSticky: any, callback: any): void;
isPhxView(el: any): any;
newRootView(el: any, flash: any, liveReferer: any): View;
owner(childEl: any, callback: any): any;
withinOwners(childEl: any, callback: any): void;
getViewByEl(el: any): any;
getRootById(id: any): any;
destroyAllViews(): void;
destroyViewByEl(el: any): void;
getActiveElement(): Element | null;
dropActiveElement(view: any): void;
restorePreviouslyActiveFocus(): void;
blurActiveElement(): void;
bindTopLevelEvents(dead?: object): void; // DT
eventMeta(eventName: any, e: any, targetEl: any): any;
setPendingLink(href: any): number;
resetReloadStatus(): void;
commitPendingLink(linkRef: any): boolean;
getHref(): string;
hasPendingLink(): boolean;
bind(events: any, callback: any): void;
bindClicks(): void;
bindClick(eventName: any, bindingName: any): void;
dispatchClickAway(e: any, clickStartedAt: any): void;
bindNav(): void;
maybeScroll(scroll: any): void;
dispatchEvent(event: any, payload?: {}): void;
dispatchEvents(events: any): void;
withPageLoading(info: any, callback: any): any;
pushHistoryPatch(e: any, href: any, linkState: any, targetEl: any): void;
historyPatch(href: any, linkState: any, linkRef?: number): void;
historyRedirect(e: any, href: any, linkState: any, flash: any, targetEl: any): void;
replaceRootHistory(): void;
registerNewLocation(newLocation: any): boolean;
bindForms(): void;
debounce(el: any, event: any, eventType: any, callback: any): any;
silenceEvents(callback: any): void;
on(event: any, callback: any): void;
jsQuerySelectorAll(sourceEl: any, query: any, defaultQuery: any): any;
}
import View from "./view";
declare class TransitionSet {
transitions: Set<any>;
pendingOps: any[];
reset(): void;
after(callback: any): void;
addTransition(time: any, onStart: any, onDone: any): void;
pushPendingOp(op: any): void;
size(): number;
flushPendingOps(): void;
transitions: Set<any>;
pendingOps: any[];
reset(): void;
after(callback: any): void;
addTransition(time: any, onStart: any, onDone: any): void;
pushPendingOp(op: any): void;
size(): number;
flushPendingOps(): void;
}
export {};
36 changes: 18 additions & 18 deletions types/phoenix_live_view/package.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
{
"private": true,
"name": "@types/phoenix_live_view",
"version": "1.0.9999",
"projects": [
"https://github.com/phoenixframework/phoenix_live_view"
],
"dependencies": {
"@types/phoenix": "*"
},
"devDependencies": {
"@types/phoenix_live_view": "workspace:."
},
"owners": [
{
"name": "Peter Zingg",
"githubUsername": "pzingg"
}
]
"private": true,
"name": "@types/phoenix_live_view",
"version": "1.0.9999",
"projects": [
"https://github.com/phoenixframework/phoenix_live_view"
],
"dependencies": {
"@types/phoenix": "*"
},
"devDependencies": {
"@types/phoenix_live_view": "workspace:."
},
"owners": [
{
"name": "Peter Zingg",
"githubUsername": "pzingg"
}
]
}
Loading

0 comments on commit b46ebd3

Please sign in to comment.