### Install Scoped App TypeScript Definitions using typings Source: https://github.com/thisnameissoclever/servicenow-dts/blob/master/README.md Installs the TypeScript definition file for scoped Service Now applications using the 'typings' package. This command fetches definitions from a GitHub repository, specifying the server-side scoped types for a particular version. ```bash typings install servicenow=github:bryceg/servicenow-dts/server/scoped-VERSION/index.d.ts#v1.7 --global ``` -------------------------------- ### Install Global/Scoped ES3 App TypeScript Definitions using typings Source: https://github.com/thisnameissoclever/servicenow-dts/blob/master/README.md Installs the TypeScript definition file for global or scoped Service Now applications targeting ES3 environments. This is an alternative to using native lib.d.ts when working with older JavaScript runtimes like Rhino. ```bash typings install github:bryceg/servicenow-dts/server/rhino-es3.d.ts#1.0 --global ``` -------------------------------- ### Initialize GlideRecord with Custom Type in TypeScript Source: https://github.com/thisnameissoclever/servicenow-dts/blob/master/README.md Shows how to instantiate a GlideRecord for the 'sys_user' table, leveraging the previously defined IUser type for enhanced type safety. This allows TypeScript to infer the types of properties accessed on the GlideRecord object. ```typescript var users = new GlideRecord('sys_user'); ``` -------------------------------- ### Extend GlideRecord Type Definitions in TypeScript Source: https://github.com/thisnameissoclever/servicenow-dts/blob/master/README.md Demonstrates how to extend the base IGlideServerRecord interface to define custom types for Service Now records, such as IUser. This allows for better type checking and autocompletion when interacting with GlideRecord instances. ```typescript declare module sn { export module Server { export interface IGlideServerRecord { new (type: 'sys_user'): sn.Types.IUser; } } export module Types { export interface IUser extends sn.Server.IGlideServerRecord { sys_id: string; firstname: string; lastname: string; name: string; user_name: string; email: string; company: any; title: string; active: boolean; source: string; } } } ``` -------------------------------- ### Configure tsconfig.json for ES3 Rhino Compatibility Source: https://github.com/thisnameissoclever/servicenow-dts/blob/master/README.md Configures the TypeScript compiler options to target ES3 and explicitly disable the inclusion of the default lib.d.ts. This is necessary when using the rhino-es3.d.ts definition file to avoid conflicts. ```json { "compilerOptions": { "target": "es3", "noLib": true } } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.