Created
January 16, 2025 09:00
-
-
Save unrevised6419/8c5ea7c75479a37c7a85283089063f34 to your computer and use it in GitHub Desktop.
FormData
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| declare global { | |
| interface FormDataEnhanced<FormName extends string> { | |
| get(name: FormName): FormDataEntryValue | null; | |
| } | |
| var FormDataEnhanced: { | |
| prototype: FormDataEnhanced<string>; | |
| new<FormName extends string>(form?: HTMLFormElement, submitter?: HTMLElement | null): FormDataEnhanced<FormName>; | |
| }; | |
| } | |
| window.FormDataEnhanced = window.FormData | |
| type FormName = 'foo' | 'bar' | |
| let formData = new FormDataEnhanced<FormName>() | |
| let value = formData.get('') | |
| export {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment