TypeScript definition files generated from the $metadata REST endpoint for SharePoint, providing type-safe access to SharePoint REST APIs. Current stable version is 2.1.3, updated as needed to match SharePoint changes. It is designed to be used with the gd-sprest library, offering auto-generated interfaces for SharePoint entities (SP, MS, OBA, PS, SPO) directly from the OData metadata. Key differentiator: eliminates manual TypeScript definitions by reflecting the actual server metadata, ensuring accuracy and up-to-date types. This library is not standalone; it requires async loading at runtime for full functionality.
npm install gd-sprest-defNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates importing multiple definition modules and using SP.Web to fetch lists, showing type-safe async API usage.
Update imports to use { SP } from 'gd-sprest-def' instead of 'require' or default import.Ensure gd-sprest's async loader is invoked before using these definitions, or use dynamic import if using in isolation (not recommended).
Generate fresh definitions against your target environment using the gd-sprest-def build script if types mismatch.
Install the package: npm install gd-sprest-def. Ensure tsconfig.json includes node_modules in typeRoots or uses 'types': ['gd-sprest-def'].
Add resolve.fullySpecified: false to webpack config, or use proper import path: import { SP } from 'gd-sprest-def'.Use type import: import type { SP } from 'gd-sprest-def' and use it only as a type, not a value.