sk-form-data
sk-form-data copied to clipboard
Types not working
I could be wrong but I thought the included types from global.d.ts would give you types.
// node_modules/sk-form-data/global.d.ts
declare namespace App {
interface Locals {
form_data: Record<string, any>
}
}
That doesn't seem to be the case.
// +page.server.ts
import type { Actions } from './$types'
export const actions: Actions = {
default: async ({ locals }) => {
locals.form_data // Property 'form_data' does not exist on type 'Locals'. 🤪
},
}
Do you need to type it yourself inside app.d.ts?
Very possible be I do personally have it in my App.d.ts. If someone else has a better all but I'll update the readme with info on augmenting your app types.
I can update the steps in #1 if you agree with the changes.
Please do so, love the README changes.
Whoops. Not sure why I closed this. Go ahead and just add it was a 2nd PR. I was a bit premature on the merge.