10
11export async function executeCommand(
12 statement: string
13): Promise<string | void> {14 const editor = vscode.window.activeTextEditor;
15 if (!editor) {
16 return;
14 *
15 * @returns void if command is called with no active text editor.
16 */
17export async function initPrintPython2(): Promise<void | string> {18 const editor = vscode.window.activeTextEditor;
19 if (!editor) {
20 return;
Disallows usage of void type outside of return types or generic type arguments. If void is used as return type, it shouldn’t be a part of intersection/union type with most other types.
type PossibleValues = string | number | void;
type MorePossibleValues = string | ((number & any) | (string | void));
function logSomething(thing: void) {}
function printArg<T = void>(arg: T) {}
logAndReturn<void>(undefined);
interface Interface {
lambda: () => void;
prop: void;
}
class MyClass {
private readonly propName: void;
}
type NoOp = () => void;
function noop(): void {}
let trulyUndefined = void 0;
async function promiseMeSomething(): Promise<void> {}
type stillVoid = void | never;