Skip to content

Commit

Permalink
fix(win): Fix missing global object
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco Crespi committed Apr 20, 2021
1 parent 9941aa3 commit 801a01b
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/bindings/win/bindings.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/// <reference types="node" />
import EventEmitter from 'events';
declare global {
const Windows: any;
let Windows: any;
}
export interface Radio extends EventEmitter {
kind: string;
Expand Down
2 changes: 1 addition & 1 deletion lib/bindings/win/bindings.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/bindings/win/bindings.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/bindings/win/bindings.js.map

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion src/bindings/win/bindings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { AddressType } from '../../models';
import * as rt from './rt-utils';

declare global {
const Windows: any;
let Windows: any;
}

try {
Expand All @@ -20,6 +20,7 @@ try {
rt.using(require('../../../build/Release/win-dev.radios.node'), 'Windows.Devices.Radios');
} catch {
// NO-OP
(global as any).Windows = null;
}

const BluetoothLEDevice = Windows?.Devices.Bluetooth.BluetoothLEDevice;
Expand Down

0 comments on commit 801a01b

Please sign in to comment.