gandjustas / sptypescript

TypeScript declarations for SharePoint JavaScript Object Model (JSOM) + lots of samples.
56 stars 20 forks source link

How to use it for SharePoint framework #14

Open jeffangama opened 6 years ago

jeffangama commented 6 years ago

sorry my newbness; is it possible to re use this for SharePoint framework webparts ? If yes, do you have a sample code and steps to reference it ? I tried installing it via npm; then importing via import { sp } ... but it says that this is not a module.

thanks

Krak86 commented 5 years ago

Hi,

First install it: npm install @types/sharepoint --save Then add reference to a top of page: /// <reference types="@types\sharepoint" />

For me it works. I use 1.5.0 version of SPFx.