Enforce some naming conventions (#4813)

This commit is contained in:
Sebastian Malton authored and GitHub committed 2022-03-01 13:06:53 -05:00
1 parent dc6615f98f
commit 0b32775d40
197 files changed
+630 -634

No files matched your search

+2 -2
View File
@@ -43,7 +43,7 @@ users:
command: foo
`;
interface kubeconfig {
interface Kubeconfig {
apiVersion: string;
clusters: [{
name: string;
@@ -66,7 +66,7 @@ interface kubeconfig {
preferences: {};
}
let mockKubeConfig: kubeconfig;
let mockKubeConfig: Kubeconfig;
describe("kube helpers", () => {
describe("validateKubeconfig", () => {
+2 -2
View File
@@ -5,10 +5,10 @@
import { EventEmitter } from "../event-emitter";
export type AppEvent = {
export interface AppEvent {
name: string;
action: string;
params?: object;
};
}
export const appEventBus = new EventEmitter<[AppEvent]>();
+2 -2
View File
@@ -14,9 +14,9 @@ export interface WebLinkStatus extends CatalogEntityStatus {
phase: WebLinkStatusPhase;
}
export type WebLinkSpec = {
export interface WebLinkSpec {
url: string;
};
}
export class WebLink extends CatalogEntity<CatalogEntityMetadata, WebLinkStatus, WebLinkSpec> {
public static readonly apiVersion = "entity.k8slens.dev/v1alpha1";
+2 -2
View File
@@ -9,12 +9,12 @@ import { crdResourcesURL } from "../../routes";
import { isClusterPageContext } from "../../utils/cluster-id-url-parsing";
import type { KubeJsonApiData } from "../kube-json-api";
type AdditionalPrinterColumnsCommon = {
interface AdditionalPrinterColumnsCommon {
name: string;
type: "integer" | "number" | "string" | "boolean" | "date";
priority: number;
description: string;
};
}
export type AdditionalPrinterColumnsV1 = AdditionalPrinterColumnsCommon & {
jsonPath: string;
+2 -2
View File
@@ -216,7 +216,7 @@ export function ensureObjectSelfLink(api: KubeApi<KubeObject>, object: KubeJsonA
export type KubeApiWatchCallback = (data: IKubeWatchEvent<KubeJsonApiData>, error: any) => void;
export type KubeApiWatchOptions = {
export interface KubeApiWatchOptions {
namespace: string;
callback?: KubeApiWatchCallback;
abortController?: AbortController;
@@ -225,7 +225,7 @@ export type KubeApiWatchOptions = {
// timeout in seconds
timeout?: number;
};
}
export type KubeApiPatchType = "merge" | "json" | "strategic";
+2 -1
View File
@@ -40,9 +40,10 @@ export * from "./splitArray";
export * from "./tar";
export * from "./toJS";
export * from "./type-narrowing";
export * from "./types";
export * from "./wait-for-path";
export type { Tuple } from "./tuple";
import * as iter from "./iter";
import * as array from "./array";
import * as tuple from "./tuple";
+1 -1
View File
@@ -3,7 +3,7 @@
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
type StaticThis<T, R extends any[]> = { new(...args: R): T };
interface StaticThis<T, R extends any[]> { new(...args: R): T }
export class Singleton {
private static instances = new WeakMap<object, Singleton>();
+8 -2
View File
@@ -8,8 +8,14 @@ import * as array from "../utils/array";
/**
* A strict N-tuple of type T
*/
export type Tuple<T, N extends number> = N extends N ? number extends N ? T[] : _TupleOf<T, N, []> : never;
type _TupleOf<T, N extends number, R extends unknown[]> = R["length"] extends N ? R : _TupleOf<T, N, [T, ...R]>;
export type Tuple<T, N extends number> = N extends N
? number extends N
? T[]
: TupleOfImpl<T, N, []>
: never;
type TupleOfImpl<T, N extends number, R extends unknown[]> = R["length"] extends N
? R
: TupleOfImpl<T, N, [T, ...R]>;
/**
* Iterates over `sources` yielding full tuples until one of the tuple arrays
-10
View File
@@ -1,10 +0,0 @@
/**
* Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
/**
* An N length tuple of T
*/
export type Tuple<T, N extends number> = N extends N ? number extends N ? T[] : _TupleOf<T, N, []> : never;
type _TupleOf<T, N extends number, R extends unknown[]> = R["length"] extends N ? R : _TupleOf<T, N, [T, ...R]>;