@types/phoenix_live_view
Advanced tools
Comparing version 0.14.0 to 0.15.0
@@ -1,2 +0,2 @@ | ||
// Type definitions for phoenix_live_view 0.14 | ||
// Type definitions for phoenix_live_view 0.15 | ||
// Project: https://github.com/phoenixframework/phoenix_live_view | ||
@@ -6,2 +6,5 @@ // Definitions by: Peter Zingg <https://github.com/pzingg> | ||
// Version 0.15.4 added options and interfaces for LiveView uploads | ||
// See: https://hexdocs.pm/phoenix_live_view/uploads.html | ||
import { Socket, SocketConnectOption } from 'phoenix'; | ||
@@ -36,2 +39,3 @@ | ||
params?: object; | ||
uploaders?: object; | ||
viewLogger?: ViewLogger; | ||
@@ -47,3 +51,2 @@ } | ||
// public | ||
connect(): void; | ||
@@ -60,22 +63,21 @@ disableDebug(): void; | ||
isDebugEnabled(): boolean; | ||
isPhxView(el: HTMLElement): boolean; | ||
isProfileEnabled(): boolean; | ||
// private | ||
// channel(topic: string, params: any): Channel; | ||
// binding(kind: any): string; | ||
// bind(events: any[], callback: BindCallback): void; | ||
// bind(events: string[], callback: BindCallback): void; | ||
// bindClick(eventName: string, bindingName: string, capture: boolean): void; | ||
// bindClicks(): void; | ||
// bindForms(): void; | ||
// binding(kind: string): string; | ||
// bindNav(): void; | ||
// bindTopLevelEvents(): void; | ||
// blurActiveElement(): void; | ||
// channel(topic: string, params: any): Channel; | ||
// commitPendingLink(linkRef: number): boolean; | ||
// debounce(el: HTMLElement, event: string, callback: any): void; | ||
// debounce(el: HTMLElement, event: Event, callback: any): void; | ||
// destroyAllViews(): void; | ||
// destroyViewByEl(el: HTMLElement): void; | ||
// dropActiveElement(view: View): void; | ||
// eventMeta(eventName: string, e: any, targetEl: HTMLElement): object; | ||
// getActiveElement(): HTMLElement; | ||
// eventMeta(eventName: string, e: Event, targetEl: HTMLElement): object; | ||
// getActiveElement(): Element; | ||
// getBindingPrefix(): string; | ||
@@ -87,20 +89,21 @@ // getHookCallbacks(hookName: string): any; | ||
// hasPendingLink(): boolean; | ||
// historyPatch(href: string, linkState: any): void; | ||
// historyRedirect(href: string, linkState: any, flash: any): void; | ||
// historyPatch(href: string, linkState: string): void; | ||
// historyRedirect(href: string, linkState: string, flash: string): void; | ||
// isConnected(): boolean; | ||
// isPhxView(el: HTMLElement): boolean; | ||
// isUnloaded(): boolean; | ||
// joinRootView(el: HTMLElement, href: string, flash: any, callback: any): View; | ||
// joinRootView(el: HTMLElement, href: string, flash: string, callback: (view: View, joinCount: number) => void): View; | ||
// joinRootViews(): boolean; | ||
// log(view: View, kind: string, msgCallback: () => [any, any]): void; | ||
// on(event: string, callback: (e: Event) => void): void; | ||
// onChannel(channel: any, event: any, cb: (data: any) => void): void; | ||
// onChannel(channel: Channel, event: string, cb: (data: any) => void): void; | ||
// owner(childEl: HTMLElement, callback: (view: View) => void): void; | ||
// pushHistoryPatch(href: string, linkState: any, targetEl: HTMLElement): void; | ||
// redirect(to: string, flash: any): void; | ||
// redirect(to: string, flash: string): void; | ||
// registerNewLocation(newLocation: Location): boolean; | ||
// reloadWithJitter(view: any): void; | ||
// replaceMain(href: string, flash: any, callback?: any, linkRef?: any): void; | ||
// reloadWithJitter(view: View): void; | ||
// replaceMain(href: string, flash: string, callback?: any, linkRef?: number): void; | ||
// replaceRootHistory(): void; | ||
// restorePreviouslyActiveFocus(): void; | ||
// setActiveElement(target: HTMLElement): void; | ||
// setActiveElement(target: Element): void; | ||
// setPendingLink(href: string): number; | ||
@@ -112,3 +115,3 @@ // silenceEvents(callback: () => void): void; | ||
// withPageLoading(info: Event, callback: any): any; | ||
// wrapPush(push: any): any; | ||
// wrapPush(view: View, opts: any, push: () => any): any; | ||
} | ||
@@ -120,6 +123,5 @@ | ||
// public | ||
componentCIDs(diff: any): number[]; | ||
componentToString(cid: number): string; | ||
expandStatics(diff: any): void; | ||
doRecursiveMerge(target: any, source: any): void; | ||
getComponent(diff: any, cid: number): any; | ||
@@ -135,3 +137,2 @@ isComponentOnlyDiff(diff: any): boolean; | ||
// private | ||
// comprehensionToBuffer(rendered: any, output: any): void; | ||
@@ -146,3 +147,3 @@ // createSpan(text: string, cid: number): HTMLSpanElement; | ||
export interface ViewHookInterface { | ||
export interface ViewHook { | ||
el: HTMLElement; | ||
@@ -165,7 +166,9 @@ viewName: string; | ||
export class View { | ||
constructor(el: HTMLElement, liveSocket: LiveSocket, parentView: View, href: string, o: any); | ||
constructor(el: HTMLElement, liveSocket: LiveSocket, parentView: View, href: string, flash: string); | ||
ackJoin(child: any): void; | ||
// public? | ||
ackJoin(child: View): void; | ||
addHook(el: HTMLElement): void; | ||
applyJoinPatch(live_patch: any, html: any, events: Array<[string, object]>): void; | ||
applyDiff(type: string, rawDiff: any, callback: any): any; | ||
applyJoinPatch(live_patch: any, html: string, events: Array<[string, object]>): void; | ||
applyPendingUpdates(): void; | ||
@@ -175,2 +178,3 @@ attachTrueDocEl(): void; | ||
binding(kind: string): any; | ||
cancelSubmit(formEl: HTMLElement): void; | ||
closestComponentID(targetCtx: object | null): number | null; | ||
@@ -183,5 +187,5 @@ componentID(el: HTMLElement): number | null; | ||
destroyDescendent(id: string): any; | ||
destroyHook(hook: ViewHookInterface): void; | ||
destroyHook(hook: ViewHook): void; | ||
dispatchEvents(events: Array<[string, object]>): void; | ||
displayError(): void; | ||
dispatchEvents(events: Array<[string, object]>): void; | ||
dropPendingRefs(): void; | ||
@@ -193,4 +197,5 @@ expandURL(to: string): string; | ||
getDescendentByEl(el: HTMLElement): any; | ||
getHook(el: HTMLElement): ViewHookInterface; | ||
getSession(): string; | ||
getHook(el: HTMLElement): ViewHook; | ||
getScheduledSubmit(formEl: HTMLElement): any; | ||
getSession(): any; | ||
getStatic(): string | null; | ||
@@ -203,3 +208,3 @@ hideLoader(): void; | ||
isMain(): boolean; | ||
join(callback?: (view: View, joinCount: number) => void): any; | ||
join(callback: any): void; | ||
joinChild(el: HTMLElement): any; | ||
@@ -212,6 +217,6 @@ joinNewChildren(): void; | ||
onChannel(event: string, cb: (resp: any) => void): void; | ||
onClose(): void; | ||
onError(reason: any): void; | ||
onClose(reason: string): void; | ||
onError(reason: string): void; | ||
onJoin(resp: object): void; | ||
onJoinComplete(resp: object, html: any, events: Array<[string, object]>): void; | ||
onJoinComplete(resp: object, html: string, events: Array<[string, object]>): void; | ||
onJoinError(resp: object): void; | ||
@@ -224,22 +229,53 @@ onLivePatch(redir: object): void; | ||
pushEvent(type: string, el: HTMLElement, targetCtx: object | null, phxEvent: string, meta: object): void; | ||
pushFileProgress(fileEl: HTMLElement, entryRef: string, progress: number, onReply?: () => void): void; | ||
pushFormRecovery(form: HTMLElement, callback: any): void; | ||
pushFormSubmit(inputEl: HTMLElement, targetCtx: object | null, kind: string, phxEvent: string, onReply: any): void; | ||
pushHookEvent(targetCtx: object | null, event: string, payload: object): void; | ||
pushInput(inputEl: HTMLElement, targetCtx: object | null, kind: string, phxEvent: string, callback: any): void; | ||
pushFormSubmit(formEl: HTMLElement, targetCtx: object | null, phxEvent: string, onReply: any): void; | ||
pushHookEvent(targetCtx: object | null, event: string, payload: object, onReply: any): void; | ||
pushInput(inputEl: HTMLElement, targetCtx: object | null, phxEvent: string, callback: any): void; | ||
pushKey(keyElement: HTMLElement, targetCtx: object | null, kind: string, phxEvent: string, meta: object): void; | ||
pushLinkPatch(href: string, targetEl: HTMLElement, callback: any): void; | ||
pushWithReply(refGenerator: any, event: string, payload: object, onReply: any): any; | ||
pushWithReply(refGenerator: any, event: string, payload: object, onReply?: () => void): any; | ||
putRef(elements: HTMLElement[], event: string): [number, HTMLElement[]]; | ||
renderContainer(diff: any, kind: string): string; | ||
setContainerClasses(...classes: any[]): void; | ||
scheduleSubmit(formEl: HTMLElement, ref: number, callback: any): boolean; | ||
setContainerClasses(...classes: string[]): void; | ||
showLoader(timeout?: number): void; | ||
submitForm(form: HTMLElement, targetCtx: object | null, phxEvent: string): void; | ||
targetComponentID(target: HTMLElement, targetCtx?: object): number | null; | ||
triggerBeforeUpdate(fromEl: HTMLElement, toEl: HTMLElement): any; | ||
triggerAwaitingSubmit(formEl: HTMLElement): void; | ||
triggerBeforeUpdateHook(fromEl: HTMLElement, toEl: HTMLElement): any; | ||
triggerReconnected(): void; | ||
triggerUpdatedHook(hook: any): void; | ||
undoRefs(ref: number): void; | ||
update(diff: any, events: Array<[string, object]>): void; | ||
undoRefs(ref: number): void; | ||
uploadFiles(formEl: HTMLElement, targetCtx: object | null, ref: number, cid: number, onComplete: any): void; | ||
withinTargets(phxTarget: string, callback: any): void; | ||
} | ||
export interface LiveViewFile extends File { | ||
_phxRef?: string; | ||
} | ||
export class UploadEntry { | ||
constructor(fileEl: HTMLInputElement, file: LiveViewFile, view: View); | ||
fileEl: HTMLInputElement; | ||
file: LiveViewFile; | ||
view: View; | ||
meta: object | null; | ||
metadata: () => object | null; | ||
progress: (progress: number) => void; | ||
cancel: () => void; | ||
isDone: () => boolean; | ||
error: (reason: string) => void; | ||
} | ||
export interface LiveViewUploaderMeta { | ||
path: string; | ||
ref: string; | ||
name: string; | ||
type: string; | ||
size: number; | ||
last_modified?: number; | ||
} | ||
export function debug(view: View, kind: string, msg: object, obj: object): void; | ||
@@ -252,8 +288,9 @@ | ||
function getCookie(name: string): string; | ||
function getHashTargetEl(hash: any): HTMLElement | null; | ||
function getHashTargetEl(maybeHash: any): HTMLElement | null; | ||
function getLocal(namespace: string, subkey: string): any; | ||
function localKey(namespace: string, subkey: string): string; | ||
function pushState(kind: any, meta: any, to: string): void; | ||
function redirect(toURL: string, flash: any): void; | ||
function pushState(kind: string, meta: object, to: string): void; | ||
function redirect(toURL: string, flash: string): void; | ||
function setCookie(name: string, value: string): void; | ||
function updateCurrentState(callback: any): void; | ||
function updateLocal(namespace: string, subkey: string, initial: any, func: (current: any) => any): any; | ||
@@ -265,9 +302,11 @@ } | ||
function byId(id: string): HTMLElement | void; | ||
function cleanChildNodes(container: any, phxUpdate: any): void; | ||
function cloneNode(node: Node, html: any): Node; | ||
function childNodeLength(html: string): number; | ||
function cleanChildNodes(container: Node, phxUpdate: string): void; | ||
function cloneNode(node: Node, html: string): Node; | ||
function copyPrivates(target: HTMLElement, source: HTMLElement): void; | ||
function debounce(el: HTMLElement, event: Event, phxDebounce: string, defaultDebounce: string | null, phxThrottle: string, defaultThrottle: string | null, callback: () => any): any; | ||
function deletePrivate(el: HTMLElement, key: string): void; | ||
function discardError(container: HTMLElement, el: HTMLElement, phxFeedbackFor: string): void; | ||
function discardError(container: Node, el: HTMLElement, phxFeedbackFor: string): void; | ||
function dispatchEvent(target: Node, eventString: string, detail?: object): void; | ||
function filterWithinSameLiveView(nodes: Node[], parent: any): any; | ||
function findComponentNode(node: Node, cid: number): HTMLElement[]; | ||
@@ -277,11 +316,18 @@ function findParentCIDs(node: Node, cids: number[]): Set<number>; | ||
function findPhxChildrenInFragment(html: string, parentId: string): HTMLElement[]; | ||
function findUploadInputs(node: Node): void | any[]; | ||
function hasSelectionRange(el: HTMLElement): boolean; | ||
function incCycle(el: HTMLElement, key: string, trigger?: any): number; | ||
function isFormInput(el: HTMLElement): boolean; | ||
function isIgnored(el: HTMLElement, phxUpdate: string): boolean; | ||
function isNowTriggerFormExternal(el: HTMLElement, phxTriggerExternal: string): boolean; | ||
function isPhxChild(el: HTMLElement): boolean; | ||
function isPhxUpdate(el: HTMLElement, phxUpdate: any, updateTypes: string[]): boolean; | ||
function isPhxChild(el: Node): boolean; | ||
function isPhxDestroyed(node: Node): boolean; | ||
function isPhxUpdate(el: Node, phxUpdate: string, updateTypes: string[]): boolean; | ||
function isTextualInput(el: HTMLElement): boolean; | ||
function isUploadInput(el: HTMLElement): boolean; | ||
function markPhxChildDestroyed(el: HTMLElement): void; | ||
function mergeAttrs(target: HTMLElement, source: HTMLElement, exclude?: string[]): void; | ||
function mergeFocusedInput(target: HTMLElement, source: HTMLElement): void; | ||
function once(el: HTMLElement, key: string): boolean; | ||
function private(el: HTMLElement, key: string): any; | ||
function putPrivate(el: HTMLElement, key: string, value: any): void; | ||
@@ -291,5 +337,7 @@ function putTitle(str: string): void; | ||
function restoreFocus(focused: HTMLElement, selectionStart: number, selectionEnd: number): void; | ||
function showError(inputEl: HTMLElement, phxFeedbackFor: string): void; | ||
function syncAttrsToProps(el: HTMLElement): void; | ||
function syncPendingRef(ref: number | null, fromEl: HTMLElement, toEl: HTMLElement): boolean; | ||
function syncPendingRef(fromEl: HTMLElement, toEl: HTMLElement, disableWith: string): boolean; | ||
function triggerCycle(el: HTMLElement, key: string, currentCycle?: number): void; | ||
function withinSameLiveView(node: Node, parent: Node): boolean; | ||
} |
{ | ||
"name": "@types/phoenix_live_view", | ||
"version": "0.14.0", | ||
"version": "0.15.0", | ||
"description": "TypeScript definitions for phoenix_live_view", | ||
@@ -24,4 +24,4 @@ "license": "MIT", | ||
}, | ||
"typesPublisherContentHash": "b6c957998b33faba50d397a9674d0a8ce11f431f7681e0d006cde9d1290bece6", | ||
"typeScriptVersion": "3.0" | ||
"typesPublisherContentHash": "46350d7a10411ec22eefecddf16c3e74af12d7af50c7f7ef859165449af90d86", | ||
"typeScriptVersion": "3.5" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
### Additional Details | ||
* Last updated: Thu, 23 Jul 2020 18:56:45 GMT | ||
* Last updated: Tue, 11 May 2021 14:31:29 GMT | ||
* Dependencies: [@types/phoenix](https://npmjs.com/package/@types/phoenix) | ||
@@ -14,0 +14,0 @@ * Global values: none |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16630
299