-
-
Notifications
You must be signed in to change notification settings - Fork 428
Conversation
Please change the formatting back to match the original (e.g. tabs instead of spaces) |
Shall I also add a |
Please inform me if you want me to add more type definitions. |
runtime/index.d.ts
Outdated
|
||
interface Stores { | ||
preloading: { | ||
subscribe(preloading: boolean): () => void; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are ready-made types for Stores in svelte that you could reuse that give a more complete type definition for subscribe (there's an optional second parameter and a return value that are missing here):
I think if you just do
import { Readable, Writable } from 'svelte/store';
...
preloading: Readable<boolean>;
you should get the correct definitions for subscribe
etc for free.
For the page store, there is also already a PageContext
interface, so you could declare it as
import { PageContext } from '@sapper/app/types';
...
page: Writeable<PageContext>;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, Thanks.
@TheComputerM this PR will need to be rebased |
Sorry, I had forgotten this. |
import { Readable, Writable } from "svelte/store"; | ||
import { PageContext } from "@sapper/app/types"; | ||
|
||
declare module "@sapper/app"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there were just removed in #1598. you might need to rebase against master
href: string, | ||
opts: { noscroll?: boolean; replaceState?: boolean } | ||
): Promise<void>; | ||
export function prefetch( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you leave the method formatting the way it was?
The linting and tests are failing with this PR |
I am going to open a new PR because this is getting cluttered. |
New PR: #1601 |
Solves #1556
Before submitting the PR, please make sure you do the following
Tests
npm test
and lint the project withnpm run lint