Skip to content

Commit

Permalink
Remove popstate event from interface
Browse files Browse the repository at this point in the history
  • Loading branch information
JAForbes committed Apr 27, 2024
1 parent 79a8cc6 commit 678d776
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions lib/index.ts
@@ -1,13 +1,13 @@
export type Window = {
location: Location,
history: History,
addEventListener(type: 'popstate', listener: (e: PopStateEvent) => void): void
removeEventListener(type: 'popstate', listener: (e: PopStateEvent) => void): void
export type _Window = {
location: _Location,
history: _History,
addEventListener(type: 'popstate', listener: () => void): void
removeEventListener(type: 'popstate', listener: () => void): void
}
export type Location = {
export type _Location = {
pathname: string
}
export type History = {
export type _History = {
replaceState(data: any, title: string, url: string): void
pushState(data: any, title: string, url: string): void
back(): void
Expand Down Expand Up @@ -36,12 +36,12 @@ interface InternalInstance {
}

interface Attrs {
_window?: Window
_window?: _Window
onChange?: (s: State) => any
}

interface ChildAttrs {
_window: Window
_window: _Window
prefix: string
onChange: OnChange
children: Set<Child>
Expand Down Expand Up @@ -75,7 +75,7 @@ export function joinPath(a:string,b: string): string {
}

function Superhistory({
_window= globalThis.window as any as Window,
_window= globalThis.window as any as _Window,
onChange = () => {},
}: Attrs = {}): InternalInstance {
const children = new Set<Child>()
Expand Down

0 comments on commit 678d776

Please sign in to comment.