import createMemoryHistory from '../../src/history/abstract.2'
-import { START } from '../../src/history/common'
+import {
+ START,
+ HistoryLocationNormalized,
+ RawHistoryLocation,
+} from '../../src/history/common'
-/** @type {import('../../src/history/base').HistoryLocation} */
-const loc = {
+const loc: RawHistoryLocation = {
path: '/foo',
}
-const loc2 = {
+const loc2: RawHistoryLocation = {
path: '/bar',
}
-const normaliezedLoc = {
+const normaliezedLoc: HistoryLocationNormalized = {
path: '/foo',
query: {},
hash: '',
fullPath: '/foo',
}
-const normaliezedLoc2 = {
+const normaliezedLoc2: HistoryLocationNormalized = {
path: '/bar',
query: {},
hash: '',
fullPath: '/bar',
}
-// TODO: figure out how to run these tests now
-describe('Abstract/in memory history', () => {
+describe('Memory history', () => {
it('starts in nowhere', () => {
const history = createMemoryHistory()
expect(history.location).toEqual(START)
import { ListenerRemover } from '../types'
-type HistoryQuery = Record<string, string | string[]>
+export type HistoryQuery = Record<string, string | string[]>
// TODO: is it reall worth allowing null to form queries like ?q&b&c
// When parsing using URLSearchParams, `q&c=` yield an empty string for q and c
// I think it's okay to allow this by default and allow extending it
// a more permissive history query
// TODO: allow numbers
-type RawHistoryQuery = Record<string, string | string[] | null>
+export type RawHistoryQuery = Record<string, string | string[] | null>
interface HistoryLocation {
// pathname section
hash?: string
}
-type RawHistoryLocation = HistoryLocation | string
+export type RawHistoryLocation = HistoryLocation | string
export interface HistoryLocationNormalized extends Required<HistoryLocation> {
// full path (like href)
-import { HistoryQuery, RawHistoryQuery } from '../history/base'
+import { HistoryQuery, RawHistoryQuery } from '../history/common'
// import Vue, { ComponentOptions, AsyncComponent } from 'vue'
// type Component = ComponentOptions<Vue> | typeof Vue | AsyncComponent