Microsoft Graph TypeScript Types
The Microsoft Graph TypeScript definitions enable editors to provide intellisense on Microsoft Graph objects including users, messages, and groups.
We recommend including the .d.ts file by downloading this package through npm.
# Install types and save in package.json as a development dependencynpm install @microsoft/microsoft-graph-types --save-dev
List my recent messages
Send an email as the logged in user
// Create the message object// Note that all the properties must follow the interface definitions.// For example, this will not compile if you try to type "xml" instead of "html" for contentType.// send the email by sending a POST request to the Microsoft Graph;;fetchrequest.then.catch;
Microsoft Graph beta support
If you want to test the Microsoft Graph beta endpoints, you can use those types simultaneously with the v1.0 types.
Update your package.json file with the following:
"devDependencies":// import published v1.0 types with a version from NPM"@microsoft/microsoft-graph-types": "^0.4.0"// import beta types from the beta branch on the GitHub repo"@microsoft/microsoft-graph-types-beta": "microsoftgraph/msgraph-typescript-typings#beta"}
Import the beta types from
// import individual entities// or import everything under MicrosoftGraphBeta
Any TypeScript project can consume these types when using at least TypeScript 2.0. We've tested including the types as a dependency in the following editors.
- Visual Studio Code
- Atom with the atom-typescript plugin
Questions and comments
We'd love to get your feedback about the TypeScript definitions project. You can send your questions and suggestions to us in the Issues section of this repository.
Please see the contributing guidelines.
If you find a security issue with our libraries or services please report it to email@example.com with as much detail as possible. Your submission may be eligible for a bounty through the Microsoft Bounty program. Please do not post security issues to GitHub Issues or any other public site. We will contact you shortly upon receiving the information. We encourage you to get notifications of when security incidents occur by visiting this page and subscribing to Security Advisory Alerts.
Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License (the "License");