Skip to content

Commit 263c878

Browse files
committed
converting ambient module declaration to explicit exports as with other types
1 parent 111acef commit 263c878

File tree

5 files changed

+41
-42
lines changed

5 files changed

+41
-42
lines changed

packages/cli/src/commands/apps/errors.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,15 @@ export default class Errors extends Command {
9191
{
9292
hostname: 'api.metrics.herokai.com',
9393
},
94-
).catch(error => {
95-
const {http} = error
94+
).catch(error_ => {
95+
const {http} = error_
9696
// eslint-disable-next-line prefer-regex-literals
9797
const match = new RegExp('^invalid process_type provided', 'i')
9898
if (http && http.statusCode === 400 && http.body && http.body.message && match.test(http.body.message)) {
9999
return {body: {data: {}}}
100100
}
101101

102-
throw error
102+
throw error_
103103
}).then(rsp => {
104104
const {body} = rsp as HTTP<AppErrors>
105105
return sumErrors(body)
Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,22 @@
11
import {Command} from '@heroku-cli/command'
2-
import type {Completion} from '@oclif/core/lib/interfaces/parser'
32
import fs from 'fs-extra'
43
import * as path from 'path'
54

5+
import type {Completion} from '../types/completion.js'
6+
67
import {CompletionLookup} from './completions.js'
78

89
export abstract class AutocompleteBase extends Command {
9-
public errorIfWindows() {
10-
if (this.config.windows) {
11-
throw new Error('Autocomplete is not currently supported in Windows')
12-
}
10+
public get acLogfilePath(): string {
11+
return path.join(this.config.cacheDir, 'autocomplete.log')
12+
}
13+
14+
public get autocompleteCacheDir(): string {
15+
return path.join(this.config.cacheDir, 'autocomplete')
16+
}
17+
18+
public get completionsCacheDir(): string {
19+
return path.join(this.config.cacheDir, 'autocomplete', 'completions')
1320
}
1421

1522
public errorIfNotSupportedShell(shell: string) {
@@ -23,25 +30,19 @@ export abstract class AutocompleteBase extends Command {
2330
}
2431
}
2532

26-
public get autocompleteCacheDir(): string {
27-
return path.join(this.config.cacheDir, 'autocomplete')
28-
}
29-
30-
public get completionsCacheDir(): string {
31-
return path.join(this.config.cacheDir, 'autocomplete', 'completions')
33+
public errorIfWindows() {
34+
if (this.config.windows) {
35+
throw new Error('Autocomplete is not currently supported in Windows')
36+
}
3237
}
3338

34-
public get acLogfilePath(): string {
35-
return path.join(this.config.cacheDir, 'autocomplete.log')
39+
protected findCompletion(cmdId: string, name: string, description = ''): Completion | undefined {
40+
return new CompletionLookup(cmdId, name, description).run()
3641
}
3742

3843
async writeLogFile(msg: string) {
3944
const now = new Date()
4045
const entry = `[${now}] ${msg}\n`
4146
await fs.appendFile(this.acLogfilePath, entry)
4247
}
43-
44-
protected findCompletion(cmdId: string, name: string, description = ''): Completion | undefined {
45-
return new CompletionLookup(cmdId, name, description).run()
46-
}
4748
}

packages/cli/src/lib/autocomplete/completions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {APIClient} from '@heroku-cli/command'
22
import {configRemote, getGitRemotes} from '@heroku-cli/command/lib/git.js'
3-
import type {Completion, CompletionContext} from '@oclif/core/lib/interfaces/parser'
3+
import type {Completion, CompletionContext} from '../types/completion.js'
44
import fs from 'fs-extra'
55
import * as path from 'path'
66
import pkg from 'lodash'
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import type {Config} from '@oclif/core'
2+
import type {Interfaces} from '@oclif/core'
3+
4+
export interface CompletionContext {
5+
config: Config
6+
flags?: Record<string, any>
7+
args?: Record<string, any>
8+
argv?: string[]
9+
}
10+
11+
export interface Completion {
12+
cacheDuration?: number
13+
cacheKey?: (ctx: CompletionContext) => Promise<string> | string
14+
options: (ctx: CompletionContext) => Promise<string[]> | string[]
15+
skipCache?: boolean
16+
}
17+
18+
export type FlagInput = Interfaces.FlagInput
19+

packages/cli/src/types/oclif-core-parser.d.ts

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)