LazyVim Default Cheat Sheet
(Leader Key: Space) (Local Leader: \
)
I. General Navigation & Editing
Key | Description | Mode |
---|
import type { ActionFunctionArgs, ActionFunction } from "@remix-run/node"; | |
import type { AnyZodObject, z } from "zod" | |
export type FormActionHandler<T extends AnyZodObject> = (data: z.infer<T>, args: ActionFunctionArgs) => Promise<Response | null> | |
export type FormAction<T extends AnyZodObject> = { | |
schema: T | |
} & { | |
handler: FormActionHandler<T> | |
} |
import { z } from "zod"; | |
type ParsedFormData<T extends z.AnyZodObject> = { | |
data: null; | |
errors: z.typeToFlattenedError<z.infer<T>>['fieldErrors'] | |
} | { | |
data: z.infer<T>; | |
errors: null; | |
} |
function base64ToBytes(base64: string): Uint8Array { | |
const binString = atob(base64); | |
return Uint8Array.from(binString, (m) => m.codePointAt(0) || 0); | |
} | |
function bytesToBase64(bytes: Uint8Array): string { | |
const binString = String.fromCodePoint(...bytes); | |
return btoa(binString); | |
} |
[ | |
{ | |
"word": "a", | |
"level": "a1", | |
"type": "indefinite article" | |
}, | |
{ | |
"word": "abandon", | |
"level": "b2", | |
"type": "verb" |
type CustomEventMap<T> = { | |
[key in keyof T]: CustomEvent | Event; | |
}; | |
interface CustomEventListener<M, K extends keyof M> { | |
(evt: M[K]): void; | |
} | |
interface CustomEventListenerObject< | |
M, |
import { view } from "./view.ts"; | |
const ListItem = ({ done, task }: { done: boolean; task: string }) => { | |
return ( | |
<li class={done ? "done" : ""}> | |
<input type="checkbox" checked={done} /> | |
<span>{task}</span> | |
<button type="button" class="delete"> | |
Delete | |
</button> |
LazyVim Default Cheat Sheet
(Leader Key: Space) (Local Leader: \
)
I. General Navigation & Editing
Key | Description | Mode |
---|