This repository was archived by the owner on Aug 7, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +23
-3
lines changed Expand file tree Collapse file tree 2 files changed +23
-3
lines changed Original file line number Diff line number Diff line change 1
- import { CompositeDisposable } from 'atom' ;
1
+ import { CompositeDisposable , TextEditor } from 'atom' ;
2
2
import path from 'path' ;
3
3
import { promises } from 'fs' ;
4
4
const { stat } = promises ;
@@ -18,7 +18,7 @@ function waitOnIdle() {
18
18
return new Promise ( ( resolve ) => {
19
19
const callbackID = window . requestIdleCallback ( ( ) => {
20
20
idleCallbacks . delete ( callbackID ) ;
21
- resolve ( ) ;
21
+ resolve ( true ) ;
22
22
} ) ;
23
23
idleCallbacks . add ( callbackID ) ;
24
24
} ) ;
@@ -138,7 +138,7 @@ const TsLintPackage = {
138
138
grammarScopes,
139
139
scope : 'file' ,
140
140
lintsOnChange : true ,
141
- lint : async ( textEditor ) => {
141
+ lint : async ( textEditor : TextEditor ) => {
142
142
if ( this . ignoreTypings && textEditor . getPath ( ) . toLowerCase ( ) . endsWith ( '.d.ts' ) ) {
143
143
return [ ] ;
144
144
}
Original file line number Diff line number Diff line change
1
+ // windows requestIdleCallback types
2
+ /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
3
+ export type RequestIdleCallbackHandle = any
4
+ type RequestIdleCallbackOptions = {
5
+ timeout : number
6
+ }
7
+ type RequestIdleCallbackDeadline = {
8
+ readonly didTimeout : boolean
9
+ timeRemaining : ( ) => number
10
+ }
11
+
12
+ declare global {
13
+ interface Window {
14
+ requestIdleCallback : (
15
+ callback : ( deadline : RequestIdleCallbackDeadline ) => void ,
16
+ opts ?: RequestIdleCallbackOptions ,
17
+ ) => RequestIdleCallbackHandle
18
+ cancelIdleCallback : ( handle : RequestIdleCallbackHandle ) => void
19
+ }
20
+ }
You can’t perform that action at this time.
0 commit comments