github.com/zppinho/prow@v0.0.0-20240510014325-1738badeb017/pkg/spyglass/lenses/coverage/vendor.d.ts (about) 1 /* 2 Copyright 2019 The Kubernetes Authors. 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15 */ 16 17 // For exciting Bazel/rollup reasons (ugh), it is impossible to `import "pako"`, which 18 // is the intended way to use this library. However, we *can* 19 // `import "pako/lib/inflate". Unfortunately, @types/pako doesn't define this 20 // module, so that then becomes a type error. This is a subset of @types/pako 21 // that we actually care about, 22 declare module "pako/lib/inflate" { 23 export = Pako; 24 namespace Pako { 25 interface InflateFunctionOptions { 26 windowBits?: number; 27 raw?: boolean; 28 to?: 'string'; 29 } 30 31 type Data = Uint8Array | number[] | string; 32 33 /** 34 * Decompress data with inflate/ungzip and options. Autodetect format via wrapper header 35 * by default. That's why we don't provide separate ungzip method. 36 */ 37 function inflate(data: Data, options: InflateFunctionOptions & { to: 'string' }): string; 38 function inflate(data: Data, options?: InflateFunctionOptions): Uint8Array; 39 40 /** 41 * The same as inflate, but creates raw data, without wrapper (header and adler32 crc). 42 */ 43 function inflateRaw(data: Data, options: InflateFunctionOptions & { to: 'string' }): string; 44 function inflateRaw(data: Data, options?: InflateFunctionOptions): Uint8Array; 45 46 /** 47 * Just shortcut to inflate, because it autodetects format by header.content. Done for convenience. 48 */ 49 function ungzip(data: Data, options: InflateFunctionOptions & { to: 'string' }): string; 50 function ungzip(data: Data, options?: InflateFunctionOptions): Uint8Array; 51 } 52 }