Giter Site home page Giter Site logo

servicenow-dts's Introduction

servicenow-dts

TypeScript Definitions for Service Now's APIs. This repository is structured into client and server side d.ts files, as well as release specific (Helsinki, Geneva, Fuji) as needed.

Installation to your project

Recommend using typings npm project to install type definitions https://github.com/typings/typings

Scoped Apps

Using typings

  • typings install servicenow=github:bryceg/servicenow-dts/server/scoped-VERSION/index.d.ts#v1.7 --global

Global and Scoped ES3 Apps

For global or scoped apps prior to Helsinki that target ES3, add the rhino d.ts reference instead of using native lib.dts

  • typings install github:bryceg/servicenow-dts/server/rhino-es3.d.ts#1.0 --global

Update your tsconfig to not use lib.d.ts when using es3 rhino

{
	"compilerOptions": {
		"target": "es3",
		"noLib": true
	}
}

Recommend

In your project add a d.ts for your own service now types that you will be using, and extend the IGlideServerRecord with your type information using overload constants.

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;
        }
    }
  }

Then you can initialize your GlideRecord for sys_user and get property type information from IUser

var users = new GlideRecord('sys_user');

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.