├── dist ├── index.js └── appsscript.json ├── .clasp.json ├── webpack.config.js ├── .travis.yml ├── LICENSE ├── package.json ├── src ├── index.ts ├── calendar.ts ├── toggl.ts └── __test__ │ └── calendar.test.ts ├── .gitignore ├── README.md └── tsconfig.json /dist/index.js: -------------------------------------------------------------------------------- 1 | // schedule: every 1 hours 2 | function main() { 3 | Main.run(); 4 | } 5 | -------------------------------------------------------------------------------- /.clasp.json: -------------------------------------------------------------------------------- 1 | { 2 | "scriptId": "1opkG2-up2ul5MyteYH-XoVwtXLJdr3PjuOZTEhJCPpY789jrFqoyGcYd", 3 | "rootDir": "dist" 4 | } 5 | -------------------------------------------------------------------------------- /dist/appsscript.json: -------------------------------------------------------------------------------- 1 | { 2 | "timeZone": "Asia/Tokyo", 3 | "dependencies": {}, 4 | "exceptionLogging": "STACKDRIVER" 5 | } 6 | -------------------------------------------------------------------------------- /webpack.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | 3 | const UglifyJsPlugin = require('uglifyjs-webpack-plugin'); 4 | 5 | module.exports = { 6 | mode: 'development', 7 | entry: './src/index.ts', 8 | output: { 9 | filename: 'bundle.js', 10 | path: path.resolve(__dirname, 'dist'), 11 | library: 'Main' 12 | }, 13 | resolve: { 14 | extensions: ['.ts', '.js'] 15 | }, 16 | module: { 17 | rules: [{ test: /\.ts$/, loader: 'ts-loader' }] 18 | }, 19 | optimization: { 20 | minimizer: [ 21 | new UglifyJsPlugin({ 22 | uglifyOptions: { ie8: true } 23 | }) 24 | ] 25 | } 26 | }; 27 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - node 4 | notifications: 5 | slack: 6 | secure: GUW4+P0YUXzElP+/X3i5ggCVJiDaO/pnoz1LLh7dD7daauo+HBlwm5X9mC8cseN8JOD/qNhTfoVcn3uV8vUoYvZhKYLYIiu5nwrJghGloJu6gIDCJlwELtcNvrX6k0VCLfZq/dIVFe48WkZzKh5evExNB5/v4WphImAEsAMMk6BhGp5f7UZhJ3IsZpUHroqYzT+e1kzLbvCCIUV0FzfLuiGYI7M0EKiiiE18ilyVmD1vIHHinHQlxEI8BBz258vD8wm0Ci7zYW7uRau1TvacURXeSuZ7vUMstXYD2wJokWweSvH82QQRuO+lV6tVqTzCPaUE9qXGkIDGh6WY+H3xt0PKftnPHiqL+B5rediH6W6wURqndGMoyW8ZjpMR/HbIzITxWhdW7noifU0GFg/hzRGEnltQhBTUdDOuU5kpktFHWZRfs4HrPXAEPMkgVQ5q/cnLRNlpaPROVcAZ+mb+5kQyikSjjNgxijFXwvBdP3ujkqlK4LIWtJeEGKs17qR/U4qnWIl6TqMgxfxAsYvlEl92O33u2pHq3YPlcwrE8AwgmeDH9zwGNvQiM4TNk3Pc/hZF7+ewH2sSqJZLSNMeECfw/5qql6OGKSwaR+zhmYIIfFprxNqkuAYFci3IZwlRybknYM3a/05KfT6zGLH/Iw31oO32wYsDYbMqnC+lPj8= 7 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Yuichi Tanikawa 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "gas-toggl-to-google-calendar", 3 | "version": "0.2.0", 4 | "author": "Yuichi Tanikawa ", 5 | "bugs": { 6 | "url": "https://github.com/uu1t/gas-toggl-to-google-calendar/issues" 7 | }, 8 | "dependencies": { 9 | "typescript": "^3.1.3" 10 | }, 11 | "devDependencies": { 12 | "@google/clasp": "^1.6.3", 13 | "@types/google-apps-script": "0.0.31", 14 | "@types/jest": "^23.3.8", 15 | "jest": "^23.6.0", 16 | "ts-jest": "^23.10.4", 17 | "ts-loader": "^5.2.2", 18 | "uglifyjs-webpack-plugin": "^2.0.1", 19 | "webpack": "^4.23.1", 20 | "webpack-cli": "^3.1.2" 21 | }, 22 | "homepage": "https://github.com/uu1t/gas-toggl-to-google-calendar#README", 23 | "jest": { 24 | "preset": "ts-jest", 25 | "testEnvironment": "node" 26 | }, 27 | "license": "MIT", 28 | "main": "dist/index.js", 29 | "repository": { 30 | "type": "git", 31 | "url": "git+https://github.com/uu1t/gas-toggl-to-google-calendar.git" 32 | }, 33 | "scripts": { 34 | "build": "webpack", 35 | "deploy": "clasp push", 36 | "predeploy": "npm run build -- -p", 37 | "test": "jest" 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | import { Client } from './toggl'; 2 | import { EntriesHash, sync } from './calendar'; 3 | 4 | export function run() { 5 | const scriptProperties = PropertiesService.getScriptProperties(); 6 | const togglApiToken = scriptProperties.getProperty('TOGGL_API_TOKEN'); 7 | const calendarId = scriptProperties.getProperty('CALENDAR_ID'); 8 | 9 | if (!togglApiToken) { 10 | throw new Error('Script property `TOGGL_API_TOKEN` is required.'); 11 | } 12 | if (!calendarId) { 13 | throw new Error('Script property `CALENDAR_ID` is required.'); 14 | } 15 | 16 | const calendar = CalendarApp.getCalendarById(calendarId); 17 | if (!calendar) { 18 | throw new Error("Can't access to the calendar: " + calendarId); 19 | } 20 | 21 | const syncPeriodInDays = 22 | Math.max(Number(scriptProperties.getProperty('SYNC_PERIOD_IN_DAYS')), 0) || 23 | 7; 24 | 25 | const now = new Date(); 26 | const startTime = new Date( 27 | now.getTime() - 1000 * 60 * 60 * 24 * syncPeriodInDays 28 | ); 29 | 30 | const client = new Client(togglApiToken); 31 | const entries = client 32 | .getTimeEntries(startTime, now) 33 | .filter(entry => !entry.isRunning); 34 | 35 | const entriesHash = entries.reduce( 36 | (hash, entry) => { 37 | hash[String(entry.id)] = entry; 38 | return hash; 39 | }, 40 | {} as EntriesHash 41 | ); 42 | sync(calendar, startTime, now, entriesHash); 43 | } 44 | -------------------------------------------------------------------------------- /src/calendar.ts: -------------------------------------------------------------------------------- 1 | import { TimeEntry } from './toggl'; 2 | 3 | const tagPrefix = 'gas-toggl-to-google-calendar_'; 4 | const teidTag = tagPrefix + 'teid'; 5 | 6 | export type EntriesHash = { [id: string]: TimeEntry }; 7 | 8 | export function sync( 9 | calendar: GoogleAppsScript.Calendar.Calendar, 10 | startTime: Date, 11 | endTime: Date, 12 | entries: EntriesHash 13 | ) { 14 | const events = calendar.getEvents(startTime, endTime); 15 | update(events, entries); 16 | create(calendar, entries); 17 | } 18 | 19 | export function update( 20 | events: GoogleAppsScript.Calendar.CalendarEvent[], 21 | entries: EntriesHash 22 | ) { 23 | for (const event of events) { 24 | const teid = event.getTag(teidTag); 25 | const entry = entries[teid]; 26 | if (!entry) { 27 | continue; 28 | } 29 | 30 | if (event.getTitle() !== entry.title) { 31 | event.setTitle(entry.title); 32 | } 33 | if ( 34 | event.getStartTime().getTime() !== entry.startTime.getTime() || 35 | event.getEndTime().getTime() !== entry.endTime.getTime() 36 | ) { 37 | event.setTime(entry.startTime, entry.endTime); 38 | } 39 | 40 | delete entries[teid]; 41 | } 42 | } 43 | 44 | export function create( 45 | calendar: GoogleAppsScript.Calendar.Calendar, 46 | entries: EntriesHash 47 | ) { 48 | for (const id of Object.keys(entries)) { 49 | const entry = entries[id]; 50 | calendar 51 | .createEvent(entry.title, entry.startTime, entry.endTime) 52 | .setTag(teidTag, id); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | dist/bundle.js 2 | 3 | 4 | ### https://raw.github.com/github/gitignore/238424389c3728e2830d929de58ca0d344557db6/Node.gitignore 5 | 6 | # Logs 7 | logs 8 | *.log 9 | npm-debug.log* 10 | yarn-debug.log* 11 | yarn-error.log* 12 | 13 | # Runtime data 14 | pids 15 | *.pid 16 | *.seed 17 | *.pid.lock 18 | 19 | # Directory for instrumented libs generated by jscoverage/JSCover 20 | lib-cov 21 | 22 | # Coverage directory used by tools like istanbul 23 | coverage 24 | 25 | # nyc test coverage 26 | .nyc_output 27 | 28 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 29 | .grunt 30 | 31 | # Bower dependency directory (https://bower.io/) 32 | bower_components 33 | 34 | # node-waf configuration 35 | .lock-wscript 36 | 37 | # Compiled binary addons (https://nodejs.org/api/addons.html) 38 | build/Release 39 | 40 | # Dependency directories 41 | node_modules/ 42 | jspm_packages/ 43 | 44 | # TypeScript v1 declaration files 45 | typings/ 46 | 47 | # Optional npm cache directory 48 | .npm 49 | 50 | # Optional eslint cache 51 | .eslintcache 52 | 53 | # Optional REPL history 54 | .node_repl_history 55 | 56 | # Output of 'npm pack' 57 | *.tgz 58 | 59 | # Yarn Integrity file 60 | .yarn-integrity 61 | 62 | # dotenv environment variables file 63 | .env 64 | 65 | # parcel-bundler cache (https://parceljs.org/) 66 | .cache 67 | 68 | # next.js build output 69 | .next 70 | 71 | # nuxt.js build output 72 | .nuxt 73 | 74 | # vuepress build output 75 | .vuepress/dist 76 | 77 | # Serverless directories 78 | .serverless 79 | 80 | # FuseBox cache 81 | .fusebox/ 82 | 83 | 84 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # toggl-to-google-calendar 2 | 3 | [![Build Status](https://travis-ci.org/uu1t/gas-toggl-to-google-calendar.svg?branch=master)](https://travis-ci.org/uu1t/gas-toggl-to-google-calendar) 4 | 5 | > :calendar: Sync Toggl time entries to Google Calendar events on Google Apps Script 6 | 7 | ## Usage 8 | 9 | 1. Build this script, which will generate `dist/bundle.js`. 10 | ``` 11 | npm install 12 | npm run build 13 | ``` 14 | 1. Upload `dist/index.js` and `dist/bundle.js` to Google Apps Script. 15 | If you're using [@google/clasp](https://github.com/google/clasp), edit `scriptId` property in `.clasp.json` and run `npm run deploy`. 16 | 1. Set `CALENDAR_ID` and `TOGGL_API_TOKEN` script properties. 17 | 1. Create a Time-driven trigger to run `main` function periodically (e.g. every hour). 18 | 19 | ### Custom variables (script properties) 20 | 21 | - `CALENDAR_ID` (required) - your Google Calendar ID 22 | - `TOGGL_API_TOKEN` (required) - your Toggl API token 23 | - `SYNC_PERIOD_IN_DAYS` (optional, default: `7`) - Toggl time entries in this period are synced to Google Calendar. 24 | 25 | ## How it works 26 | 27 | 1. Retrieve Toggl time entries and Google Calendar events in the past `SYNC_PERIOD_IN_DAYS` days 28 | 1. For each Toggl time entry, create a corresponding Calendar event or update the corresponding Calendar event if it changed. 29 | 30 | ## Limitations 31 | 32 | Due to [Toggl API](https://github.com/toggl/toggl_api_docs/blob/master/chapters/time_entries.md#get-time-entries-started-in-a-specific-time-range) and current implementation, there are 2 limitations: 33 | 34 | - Time entries lasting beyond `SYNC_PERIOD_IN_DAYS` days are not synced. 35 | - If there are more than 1000 time entries in the past `SYNC_PERIOD_IN_DAYS` days, some time entries may not be synced. 36 | 37 | ## Alternatives 38 | 39 | - automate with [Zapier](https://zapier.com/) or [Integromat](https://www.integromat.com/) 40 | - cons: the number of executions per month are limited on the free plan (100 tasks on Zapier and 1000 operations on Integromat). 41 | - Toggl iCal integration 42 | - cons: need to upgrade to the starter plan of Toggl. 43 | -------------------------------------------------------------------------------- /src/toggl.ts: -------------------------------------------------------------------------------- 1 | const baseUrl = 'https://www.toggl.com/api/v8/'; 2 | 3 | export interface Project { 4 | id: number; 5 | name: string; 6 | } 7 | 8 | interface TimeEntryJSON { 9 | id: number; 10 | description: string; 11 | pid?: number; 12 | start: string; 13 | stop?: string; 14 | duration: number; 15 | } 16 | 17 | export class TimeEntry implements TimeEntryJSON { 18 | constructor( 19 | public id: number, 20 | public description: string, 21 | public start: string, 22 | public duration: number, 23 | public stop?: string, 24 | public pid?: number, 25 | // populated 26 | public project?: Project 27 | ) {} 28 | 29 | get startTime(): Date { 30 | return new Date(this.start); 31 | } 32 | 33 | get endTime(): Date { 34 | return new Date(this.stop!); 35 | } 36 | 37 | get title(): string { 38 | return this.description + (this.project ? ` [${this.project!.name}]` : ''); 39 | } 40 | 41 | get isRunning(): boolean { 42 | return this.duration < 0; 43 | } 44 | 45 | static fromJSON(json: TimeEntryJSON): TimeEntry { 46 | const entry = Object.create(TimeEntry.prototype); 47 | for (const key in json) { 48 | entry[key] = (json as any)[key]; 49 | } 50 | return entry; 51 | } 52 | } 53 | 54 | export class Client { 55 | projects: { [key: number]: Project } = {}; 56 | 57 | constructor(public token: string) {} 58 | 59 | getProject(pid: number): Project { 60 | if (this.projects[pid]) { 61 | return this.projects[pid]; 62 | } 63 | const path = `projects/${pid}`; 64 | const { data } = this.get<{ data: Project }>(path); 65 | this.projects[pid] = data; 66 | return data; 67 | } 68 | 69 | getTimeEntries(startTime: Date, endTime: Date): TimeEntry[] { 70 | const path = 71 | 'time_entries?' + 72 | [ 73 | `start_date=${encodeURIComponent(startTime.toISOString())}`, 74 | `end_date=${encodeURIComponent(endTime.toISOString())}` 75 | ].join('&'); 76 | const entries = this.get(path).map(TimeEntry.fromJSON); 77 | for (const entry of entries) { 78 | if (entry.pid) { 79 | entry.project = this.getProject(entry.pid); 80 | } 81 | } 82 | return entries; 83 | } 84 | 85 | private get(path: string): T { 86 | const url = baseUrl + path; 87 | const params = { 88 | contentType: 'application/json', 89 | headers: { 90 | Authorization: 91 | 'Basic ' + Utilities.base64Encode(`${this.token}:api_token`) 92 | }, 93 | method: 'get' as 'get' 94 | }; 95 | const contentText = UrlFetchApp.fetch(url, params).getContentText(); 96 | return JSON.parse(contentText); 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /src/__test__/calendar.test.ts: -------------------------------------------------------------------------------- 1 | import { update } from '../calendar'; 2 | import { TimeEntry } from '../toggl'; 3 | 4 | const CalendarEvent = jest.fn( 5 | (title: string, startTime: Date, endTime: Date, tag: string) => ({ 6 | getTitle: () => title, 7 | setTitle: (t: string) => { 8 | title = t; 9 | }, 10 | getStartTime: () => startTime, 11 | getEndTime: () => endTime, 12 | setTime: (s: Date, e: Date) => { 13 | startTime = s; 14 | endTime = e; 15 | }, 16 | getTag: (_key: string) => tag, 17 | setTag: (_key: string, t: string) => { 18 | tag = t; 19 | } 20 | }) 21 | ); 22 | 23 | describe('CalendarEventMock', () => { 24 | test('title getter/setter', () => { 25 | const event = new CalendarEvent('title1'); 26 | expect(event.getTitle()).toBe('title1'); 27 | 28 | event.setTitle('title2'); 29 | expect(event.getTitle()).toBe('title2'); 30 | }); 31 | 32 | test('time getter/setter', () => { 33 | const event = new CalendarEvent( 34 | '', 35 | new Date('2018-10-28'), 36 | new Date('2018-10-29') 37 | ); 38 | expect(event.getStartTime()).toEqual(new Date('2018-10-28')); 39 | expect(event.getEndTime()).toEqual(new Date('2018-10-29')); 40 | 41 | event.setTime(new Date('2018-12-30'), new Date('2018-12-31')); 42 | expect(event.getStartTime()).toEqual(new Date('2018-12-30')); 43 | expect(event.getEndTime()).toEqual(new Date('2018-12-31')); 44 | }); 45 | 46 | test('tag getter/setter', () => { 47 | const event = new CalendarEvent('', new Date(), new Date(), 'tag1'); 48 | expect(event.getTag('')).toBe('tag1'); 49 | 50 | event.setTag('', 'tag2'); 51 | expect(event.getTag('')).toBe('tag2'); 52 | }); 53 | }); 54 | 55 | describe('update()', () => { 56 | it("sets time entries' changes", () => { 57 | const events = [ 58 | ['title1', new Date('2018-10-01'), new Date('2018-10-02'), '1'], 59 | ['title2', new Date('2018-10-03'), new Date('2018-10-04'), '2'], 60 | ['title3', new Date('2018-10-05'), new Date('2018-10-06'), '3'], 61 | ['title4', new Date('2018-10-07'), new Date('2018-10-08'), '4'] 62 | ].map(e => new CalendarEvent(...e)); 63 | 64 | const entries = { 65 | '1': new TimeEntry( 66 | 1, 67 | 'title1', 68 | '2018-10-01T00:00:00.000Z', 69 | 86400, 70 | '2018-10-02T00:00:00.000Z' 71 | ), 72 | '2': new TimeEntry( 73 | 2, 74 | 'title2-changed', 75 | '2018-10-03T00:00:00.000Z', 76 | 86400, 77 | '2018-10-04T00:00:00.000Z' 78 | ), 79 | '3': new TimeEntry( 80 | 3, 81 | 'title3', 82 | '2018-10-05T12:00:00.000Z', 83 | 43200, 84 | '2018-10-06T00:00:00.000Z' 85 | ), 86 | '4': new TimeEntry( 87 | 4, 88 | 'title4', 89 | '2018-10-07T00:00:00.000Z', 90 | 43200, 91 | '2018-10-07T12:00:00.000Z' 92 | ), 93 | '5': new TimeEntry( 94 | 5, 95 | 'title5', 96 | '2018-10-09T00:00:00.000Z', 97 | 86400, 98 | '2018-10-10T00:00:00.000Z' 99 | ) 100 | }; 101 | 102 | update(events, entries); 103 | 104 | expect(events[1].getTitle()).toBe('title2-changed'); 105 | expect(events[2].getStartTime()).toEqual(new Date('2018-10-05 12:00Z')); 106 | expect(events[3].getEndTime()).toEqual(new Date('2018-10-07 12:00Z')); 107 | 108 | expect(Object.keys(entries)).toHaveLength(1); 109 | expect(entries).toHaveProperty('5'); 110 | }); 111 | }); 112 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | /* Basic Options */ 4 | "target": "es5" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */, 5 | "module": "es2015" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */, 6 | "lib": [ 7 | "es2015" 8 | ] /* Specify library files to be included in the compilation. */, 9 | // "allowJs": true, /* Allow javascript files to be compiled. */ 10 | // "checkJs": true, /* Report errors in .js files. */ 11 | // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ 12 | // "declaration": true, /* Generates corresponding '.d.ts' file. */ 13 | // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ 14 | // "sourceMap": true, /* Generates corresponding '.map' file. */ 15 | // "outFile": "./", /* Concatenate and emit output to single file. */ 16 | // "outDir": "./", /* Redirect output structure to the directory. */ 17 | // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ 18 | // "composite": true, /* Enable project compilation */ 19 | // "removeComments": true, /* Do not emit comments to output. */ 20 | // "noEmit": true, /* Do not emit outputs. */ 21 | // "importHelpers": true, /* Import emit helpers from 'tslib'. */ 22 | // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ 23 | // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ 24 | 25 | /* Strict Type-Checking Options */ 26 | "strict": true /* Enable all strict type-checking options. */, 27 | // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ 28 | // "strictNullChecks": true, /* Enable strict null checks. */ 29 | // "strictFunctionTypes": true, /* Enable strict checking of function types. */ 30 | // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ 31 | // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ 32 | // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ 33 | 34 | /* Additional Checks */ 35 | "noUnusedLocals": true /* Report errors on unused locals. */, 36 | "noUnusedParameters": true /* Report errors on unused parameters. */, 37 | "noImplicitReturns": true /* Report error when not all code paths in function return a value. */, 38 | "noFallthroughCasesInSwitch": true /* Report errors for fallthrough cases in switch statement. */, 39 | 40 | /* Module Resolution Options */ 41 | "moduleResolution": "node" /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */, 42 | // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ 43 | // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ 44 | // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ 45 | // "typeRoots": [], /* List of folders to include type definitions from. */ 46 | // "types": [], /* Type declaration files to be included in compilation. */ 47 | // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ 48 | "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ 49 | // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ 50 | 51 | /* Source Map Options */ 52 | // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ 53 | // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ 54 | // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ 55 | // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ 56 | 57 | /* Experimental Options */ 58 | // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ 59 | // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ 60 | } 61 | } 62 | --------------------------------------------------------------------------------