Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/tsafe/lab/defineAccessors.ts>defineAccessors

🔩 The missing TypeScript utils
Go to Latest
variable defineAccessors
import { defineAccessors } from "https://deno.land/x/tsafe@v1.0.1/lab/defineAccessors.ts";

type

<T extends Record<string, unknown>, K extends keyof T>(
obj: T,
propertyName: K,
propertyDescriptor: { get?: () => T[K]; set?: (value: T[K]) => void; },
) => void