Skip to content

Commit

Permalink
QA: Remove plural
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesst20 committed Jun 26, 2024
1 parent 3d07f5e commit d0a01f2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions packages/svelte/src/lib/createInertiaApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@ import type { ComponentType } from 'svelte'
import App from './components/App.svelte'
import SSR, { type SSRProps } from './components/SSR.svelte'
import store from './store'
import type { ComponentsResolver, ResolvedComponents } from './types'
import type { ComponentResolver, ResolvedComponent } from './types'

type SvelteRenderResult = { html: string; head: string; css: { code: string } }
type SSRComponent = ComponentType<SSR> & { render: (props: SSRProps) => SvelteRenderResult }

interface CreateInertiaAppProps {
id?: string
resolve: ComponentsResolver
resolve: ComponentResolver
setup: (props: {
el: Element
App: ComponentType<App>
props: {
initialPage: Page
resolveComponent: ComponentsResolver
resolveComponent: ComponentResolver
}
}) => void | App
progress?:
Expand Down Expand Up @@ -59,7 +59,7 @@ export default async function createInertiaApp({
resolveComponent,
swapComponent: async ({ component, page, preserveState }) => {
store.update((current) => ({
component: component as ResolvedComponents,
component: component as ResolvedComponent,
page,
key: preserveState ? current.key : Date.now(),
}))
Expand Down
4 changes: 2 additions & 2 deletions packages/svelte/src/lib/store.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { Page } from '@inertiajs/core'
import { writable } from 'svelte/store'
import type { ResolvedComponents } from './types'
import type { ResolvedComponent } from './types'

interface Store {
component: ResolvedComponents | null
component: ResolvedComponent | null
page: Page | null
key?: number | null
}
Expand Down
4 changes: 2 additions & 2 deletions packages/svelte/src/lib/types.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { ComponentType } from 'svelte'

export type ComponentsResolver = (name: string) => ResolvedComponents | Promise<ResolvedComponents>
export type ComponentResolver = (name: string) => ResolvedComponent | Promise<ResolvedComponent>

export type ResolvedComponents = {
export type ResolvedComponent = {
default?: ComponentType
layout?: ComponentType
}

0 comments on commit d0a01f2

Please sign in to comment.