▸case-02 When I attempt to extend an exported interface from an npm package, TypeScript fails to recognize the new fields and React types like `ReactNode` resolve to `any`. Can you write a proper type declaration file to fix my module augmentation setup? | fail→pass | 11,138 | 9,901 | -11% | 1 | 1 | 0% | 1,932 | 1,865 | -3% | 0 | 0 | — |
▸case-01 I need to add custom prop types to a third-party library's subpath export (`markdown-flow-ui/slide`) in my TypeScript project. Could you provide a `.d.ts` module augmentation file to achieve this correctly along with a breakdown of the code structure? | fail→pass | 13,487 | 8,155 | -40% | 1 | 1 | 0% | 2,254 | 1,728 | -23% | 0 | 0 | — |
▸case-03 We want to augment an existing interface exposed by an external module in our TypeScript repository without breaking existing type exports. Please show me how to structure the declaration file and the verification steps I should follow. | fail→pass | 14,311 | 10,383 | -27% | 1 | 1 | 0% | 2,436 | 2,122 | -13% | 0 | 0 | — |
▸case-04 I want to add a missing property to an interface in a third-party UI library. I'm planning to immediately write a module declaration. Should I jump straight to writing the augmentation code or is there an initial verification step on disk I should perform first? | pass→pass | 10,058 | 5,878 | -42% | 1 | 1 | 0% | 1,640 | 1,285 | -22% | 0 | 0 | — |
▸case-05 I am extending the props of a slide subcomponent from `markdown-flow-ui/slide`. Many developers augment the root package `markdown-flow-ui` directly because it feels cleaner. What module path should be specified in the `declare module` block so runtime entry points and types align? | pass→pass | 12,682 | 7,131 | -44% | 1 | 1 | 0% | 2,079 | 1,431 | -31% | 0 | 0 | — |
▸case-06 I am creating a `.d.ts` file to augment a type exported from `@auth/core`. I want to keep the file as clean as possible without any top-level side-effect imports or exports. Is it safe to write `declare module '@auth/core' { ... }` as a script file without top-level imports/exports? | fail→pass | 10,499 | 7,448 | -29% | 1 | 1 | 0% | 1,789 | 1,581 | -12% | 0 | 0 | — |
▸case-07 I need to add a custom property to a third-party type definition. The package exports a type alias `type UserConfig = { theme: string }`. I plan to directly augment `UserConfig` using `declare module` syntax. Is augmenting type aliases supported or should I use a wrapper type locally? | pass→pass | 11,162 | 6,124 | -45% | 1 | 1 | 0% | 1,789 | 1,193 | -33% | 0 | 0 | — |
▸case-08 When creating a `.d.ts` module augmentation file for a package, I plan to copy the entire original `index.d.ts` file structure into my `declare module` block and add my new fields. Is re-declaring the whole module structure recommended? | pass→pass | 11,062 | 7,221 | -35% | 1 | 1 | 0% | 1,816 | 1,560 | -14% | 0 | 0 | — |
▸case-09 In my module augmentation file, my newly added interface field references `InteractionDefaultValueOptions` from an external helper library. Should I rely on ambient global resolution or explicitly import the dependency type into the augmentation context? | pass→pass | 12,174 | 4,920 | -60% | 1 | 1 | 0% | 1,966 | 1,059 | -46% | 0 | 0 | — |
▸case-10 My TypeScript build fails with a type mismatch after adding module augmentation. Should I immediately add `// @ts-ignore` to bypass it, or what initial investigation step should I take regarding upstream definitions versus local overrides? | pass→pass | 13,661 | 10,313 | -25% | 1 | 1 | 0% | 2,125 | 1,986 | -7% | 0 | 0 | — |
▸case-11 After updating our module augmentation files across a large monorepo, what explicit verification command or check should be performed to ensure we haven't inadvertently stripped any exported members from the original module? | pass→pass | 14,719 | 11,404 | -23% | 1 | 1 | 0% | 2,201 | 1,980 | -10% | 0 | 0 | — |
▸case-12 I am adding a `renderIcon?: ReactNode` property to an external library's component interface via module augmentation. If I use `import React from 'react'` or omit top-level imports, TypeScript collapses `ReactNode` to `any`. How should `ReactNode` be imported in the `.d.ts` file? | pass→pass | 10,109 | 6,057 | -40% | 1 | 1 | 0% | 1,773 | 1,334 | -25% | 0 | 0 | — |
▸case-13 Why is `export {};` required at the top level of a TypeScript module augmentation `.d.ts` file when no other top-level exports exist? | pass→pass | 11,551 | 11,931 | +3% | 1 | 1 | 0% | 1,988 | 2,101 | +6% | 0 | 0 | — |
▸case-14 Our team wants to augment a component from `express-serve-static-core`. A developer suggested placing the augmentation inside `declare module 'express'` because Express re-exports core types. Is augmenting the root package sufficient for subpath-specific types? | pass→pass | 13,904 | 6,831 | -51% | 1 | 1 | 0% | 2,311 | 1,399 | -39% | 0 | 0 | — |
▸case-15 Can I use TypeScript module augmentation (`declare module`) to add fields to a private, non-exported class internal to an npm package? | fail→pass | 11,142 | 9,087 | -18% | 1 | 1 | 0% | 1,827 | 1,614 | -12% | 0 | 0 | — |
▸case-16 I need to add a property to a union type `type Status = 'open' | 'closed'` exported by a package. Direct module augmentation doesn't work on union types. What structural approach should I take in my application code? | pass→pass | 12,189 | 6,667 | -45% | 1 | 1 | 0% | 1,972 | 1,337 | -32% | 0 | 0 | — |
▸case-17 How do I configure `compilerOptions.paths` in `tsconfig.json` to alias `@components` to `./src/components`? | pass→pass | 8,410 | 6,305 | -25% | 1 | 1 | 0% | 1,261 | 1,211 | -4% | 0 | 0 | — |
▸case-18 What fields are required in `package.json` to correctly publish a dual ESM/CommonJS TypeScript package with type declarations? | pass→pass | 16,305 | 12,061 | -26% | 1 | 1 | 0% | 2,893 | 2,362 | -18% | 0 | 0 | — |
▸case-19 How do I write a generic TypeScript utility type `DeepPartial<T>` that recursively makes all properties optional? | pass→pass | 14,267 | 11,843 | -17% | 1 | 1 | 0% | 2,451 | 2,352 | -4% | 0 | 0 | — |
▸case-20 Why does `ts-node` fail with `SyntaxError: Cannot use import statement outside a module` when running ESM files, and how do I fix it? | pass→pass | 11,503 | 10,562 | -8% | 1 | 1 | 0% | 1,991 | 2,151 | +8% | 0 | 0 | — |
▸case-21 When augmenting `markdown-flow-ui/slide`, should the top-level import statement import from `markdown-flow-ui` or from `markdown-flow-ui/slide`? | pass→pass | 7,491 | 4,688 | -37% | 1 | 1 | 0% | 1,274 | 1,037 | -19% | 0 | 0 | — |
▸case-22 I need to reference `ReactElement` in my module augmentation interface. Show me the exact top-level import line needed to bring in `ReactElement` safely without type degradation. | pass→pass | 7,729 | 3,435 | -56% | 1 | 1 | 0% | 1,181 | 802 | -32% | 0 | 0 | — |