Kotlin / dukat

Converter of <any kind of declarations> to Kotlin external declarations
553 stars 44 forks source link

stream.stream produces duplicate overloads: val write: ((chunk: Any, encoding: String /* "ascii" */... #339

Closed vlsi closed 4 years ago

vlsi commented 4 years ago
plugins {
    kotlin("js") version "1.4.0-rc"
}

dependencies {
    implementation(npm("@actions/github", "4.0.0", generateExternals = true))
}
    interface WritableOptions {
        var highWaterMark: Number?
            get() = definedExternally
            set(value) = definedExternally
        var decodeStrings: Boolean?
            get() = definedExternally
            set(value) = definedExternally
        var defaultEncoding: String? /* "ascii" | "utf8" | "utf-8" | "utf16le" | "ucs2" | "ucs-2" | "base64" | "latin1" | "binary" | "hex" */
            get() = definedExternally
            set(value) = definedExternally
        var objectMode: Boolean?
            get() = definedExternally
            set(value) = definedExternally
        var emitClose: Boolean?
            get() = definedExternally
            set(value) = definedExternally
        val write: ((chunk: Any, encoding: String /* "ascii" */, callback: (error: Error?) -> Unit) -> Unit)?
            get() = definedExternally
        val write: ((chunk: Any, encoding: String /* "utf8" */, callback: (error: Error?) -> Unit) -> Unit)?
            get() = definedExternally
        val write: ((chunk: Any, encoding: String /* "utf-8" */, callback: (error: Error?) -> Unit) -> Unit)?
            get() = definedExternally
        val write: ((chunk: Any, encoding: String /* "utf16le" */, callback: (error: Error?) -> Unit) -> Unit)?
            get() = definedExternally
        val write: ((chunk: Any, encoding: String /* "ucs2" */, callback: (error: Error?) -> Unit) -> Unit)?
            get() = definedExternally
        val write: ((chunk: Any, encoding: String /* "ucs-2" */, callback: (error: Error?) -> Unit) -> Unit)?
            get() = definedExternally
vlsi commented 4 years ago

I guess here's the definition: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/5e1fd7eaf08eba32531f4fb9f0d9f147d6fef9aa/types/readable-stream/index.d.ts#L246-L251

    type WritableOptions = WritableStateOptions & {
        write?(this: Writable, chunk: any, encoding: BufferEncoding | string, callback: (error?: Error | null) => void): void;
        writev?(this: Writable, chunk: ArrayLike<{ chunk: any; encoding: BufferEncoding | string }>, callback: (error?: Error | null) => void): void;
        destroy?(this: Writable, error: Error | null, callback: (error: Error | null) => void): void;
        final?(this: Writable, callback: (error?: Error | null) => void): void;
    };

and

https://github.com/DefinitelyTyped/DefinitelyTyped/blob/816d93383ec31c96e22fc2b9a7a8e88eb4d0f6f2/types/node/globals.d.ts#L66

type BufferEncoding = "ascii" | "utf8" | "utf-8" | "utf16le" | "ucs2" | "ucs-2" | "base64" | "latin1" | "binary" | "hex";