Skip to content

Commit

Permalink
JS. Use common @JsPlainObject annotation (#2449)
Browse files Browse the repository at this point in the history
  • Loading branch information
turansky committed Dec 9, 2024
1 parent c870373 commit 40b373b
Show file tree
Hide file tree
Showing 91 changed files with 96 additions and 96 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default (node, context) => {
)
)
) {
return `@kotlinx.js.JsPlainObject`
return `@js.objects.JsPlainObject`
}

return null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package electron.core

import web.http.RequestInit

@kotlinx.js.JsPlainObject
@js.objects.JsPlainObject
external interface NetFetchInit : RequestInit {
var bypassCustomProtocolHandlers: Boolean?
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package electron.core

import web.http.RequestInit

@kotlinx.js.JsPlainObject
@js.objects.JsPlainObject
external interface SessionFetchInit : RequestInit {
var bypassCustomProtocolHandlers: Boolean?
}
12 changes: 6 additions & 6 deletions kotlin-node/karakum/annotations/annotateJsPlainObject.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,21 +79,21 @@ export default (node, context) => {
&& ts.isInterfaceDeclaration(node)
&& node.name.text === "StreamOptions"
) {
return `@kotlinx.js.JsPlainObject`
return `@js.objects.JsPlainObject`
}

if (
ts.isInterfaceDeclaration(node)
&& jsoInterfaces.some(name => node.name.text === name)
) {
return `@kotlinx.js.JsPlainObject`
return `@js.objects.JsPlainObject`
}

if (
ts.isInterfaceDeclaration(node)
&& jsoInterfacesWithGenerics.some(name => node.name.text === name)
) {
return `@kotlinx.js.JsPlainObject`
return `@js.objects.JsPlainObject`
}

if (
Expand All @@ -117,7 +117,7 @@ export default (node, context) => {
|| node.parent.parent.name.text === "mkdirSync"
)
) {
return `@kotlinx.js.JsPlainObject`
return `@js.objects.JsPlainObject`
}

if (
Expand Down Expand Up @@ -154,7 +154,7 @@ export default (node, context) => {
|| node.parent.parent.parent.parent.name.text === "watchFile"
)
) {
return `@kotlinx.js.JsPlainObject`
return `@js.objects.JsPlainObject`
}

if (
Expand All @@ -181,7 +181,7 @@ export default (node, context) => {
|| node.parent.parent.parent.parent.name.text === "writeFile"
)
) {
return `@kotlinx.js.JsPlainObject`
return `@js.objects.JsPlainObject`
}

return null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

package node.childProcess

@kotlinx.js.JsPlainObject
@js.objects.JsPlainObject
sealed external interface CommonExecOptions : CommonOptions {
var input: Any? /* string | NodeJS.ArrayBufferView | undefined */

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

package node.childProcess

@kotlinx.js.JsPlainObject
@js.objects.JsPlainObject
sealed external interface CommonOptions : ProcessEnvOptions {
/**
* @default false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package node.childProcess

import web.abort.Abortable

@kotlinx.js.JsPlainObject
@js.objects.JsPlainObject
sealed external interface CommonSpawnOptions : CommonOptions, MessagingOptions, Abortable {
var argv0: String?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

package node.childProcess

@kotlinx.js.JsPlainObject
@js.objects.JsPlainObject
sealed external interface ExecBufferOptions : ExecOptions {
var encoding: String /* "buffer" */?
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ package node.childProcess

import node.fs.ObjectEncodingOptions

@kotlinx.js.JsPlainObject
@js.objects.JsPlainObject
sealed external interface ExecFileObjectEncodingOptions : ObjectEncodingOptions, ExecFileOptions
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package node.childProcess
import web.abort.AbortSignal
import web.abort.Abortable

@kotlinx.js.JsPlainObject
@js.objects.JsPlainObject
sealed external interface ExecFileOptions : CommonOptions, Abortable {
var maxBuffer: Double?
var killSignal: Any? /* NodeJS.Signals | number | undefined */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

package node.childProcess

@kotlinx.js.JsPlainObject
@js.objects.JsPlainObject
sealed external interface ExecFileOptionsWithBufferEncoding : ExecFileOptions {
var encoding: String /* "buffer" */?
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

package node.childProcess

@kotlinx.js.JsPlainObject
@js.objects.JsPlainObject
sealed external interface ExecFileOptionsWithOtherEncoding : ExecFileOptions {
var encoding: node.buffer.BufferEncoding
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

package node.childProcess

@kotlinx.js.JsPlainObject
@js.objects.JsPlainObject
sealed external interface ExecFileOptionsWithStringEncoding : ExecFileOptions {
var encoding: node.buffer.BufferEncoding
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

package node.childProcess

@kotlinx.js.JsPlainObject
@js.objects.JsPlainObject
sealed external interface ExecFileSyncOptions : CommonExecOptions {
var shell: Any? /* boolean | string | undefined */
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

package node.childProcess

@kotlinx.js.JsPlainObject
@js.objects.JsPlainObject
sealed external interface ExecFileSyncOptionsWithBufferEncoding : ExecFileSyncOptions {
@JsName("encoding")
var bufferEncoding: String /* "buffer" */?// specify `null`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

package node.childProcess

@kotlinx.js.JsPlainObject
@js.objects.JsPlainObject
sealed external interface ExecFileSyncOptionsWithStringEncoding : ExecFileSyncOptions {
@JsName("encoding")
var stringEncoding: node.buffer.BufferEncoding
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ package node.childProcess

import node.fs.ObjectEncodingOptions

@kotlinx.js.JsPlainObject
@js.objects.JsPlainObject
sealed external interface ExecObjectEncodingOptions : ObjectEncodingOptions, ExecOptions
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package node.childProcess

import web.abort.AbortSignal

@kotlinx.js.JsPlainObject
@js.objects.JsPlainObject
sealed external interface ExecOptions : CommonOptions {
var shell: String?
var signal: AbortSignal?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

package node.childProcess

@kotlinx.js.JsPlainObject
@js.objects.JsPlainObject
sealed external interface ExecOptionsWithBufferEncoding : ExecOptions {
var encoding: node.buffer.BufferEncoding?// specify `null`.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

package node.childProcess

@kotlinx.js.JsPlainObject
@js.objects.JsPlainObject
sealed external interface ExecOptionsWithStringEncoding : ExecOptions {
var encoding: node.buffer.BufferEncoding
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

package node.childProcess

@kotlinx.js.JsPlainObject
@js.objects.JsPlainObject
sealed external interface ExecStringOptions : ExecOptions {
var encoding: node.buffer.BufferEncoding
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

package node.childProcess

@kotlinx.js.JsPlainObject
@js.objects.JsPlainObject
sealed external interface ExecSyncOptions : CommonExecOptions {
var shell: String?
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

package node.childProcess

@kotlinx.js.JsPlainObject
@js.objects.JsPlainObject
sealed external interface ExecSyncOptionsWithBufferEncoding : ExecSyncOptions {
@JsName("encoding")
var bufferEncoding: String /* "buffer" */?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

package node.childProcess

@kotlinx.js.JsPlainObject
@js.objects.JsPlainObject
sealed external interface ExecSyncOptionsWithStringEncoding : ExecSyncOptions {
@JsName("encoding")
var stringEncoding: node.buffer.BufferEncoding
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package node.childProcess

import web.abort.Abortable

@kotlinx.js.JsPlainObject
@js.objects.JsPlainObject
sealed external interface ForkOptions : ProcessEnvOptions, MessagingOptions, Abortable {
var execPath: String?
var execArgv: js.array.ReadonlyArray<String>?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package node.childProcess

import web.abort.Abortable

@kotlinx.js.JsPlainObject
@js.objects.JsPlainObject
sealed external interface MessagingOptions : Abortable {
/**
* Specify the kind of serialization used for sending messages between processes.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

package node.childProcess

@kotlinx.js.JsPlainObject
@js.objects.JsPlainObject
sealed external interface ProcessEnvOptions {
var uid: Double?
var gid: Double?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

package node.childProcess

@kotlinx.js.JsPlainObject
@js.objects.JsPlainObject
sealed external interface SpawnOptions : CommonSpawnOptions {
var detached: Boolean?
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

package node.childProcess

@kotlinx.js.JsPlainObject
@js.objects.JsPlainObject
sealed external interface SpawnOptionsWithStdioTuple<Stdin : Any? /* StdioNull | StdioPipe */, Stdout : Any? /* StdioNull | StdioPipe */, Stderr : Any? /* StdioNull | StdioPipe */> :
SpawnOptions {
@JsName("stdio")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

package node.childProcess

@kotlinx.js.JsPlainObject
@js.objects.JsPlainObject
sealed external interface SpawnOptionsWithoutStdio : SpawnOptions {
override var stdio: Any? /* StdioPipeNamed | StdioPipe[] | undefined */
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

package node.childProcess

@kotlinx.js.JsPlainObject
@js.objects.JsPlainObject
sealed external interface SpawnSyncOptions : CommonSpawnOptions {
var input: Any? /* string | NodeJS.ArrayBufferView | undefined */
var maxBuffer: Double?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

package node.childProcess

@kotlinx.js.JsPlainObject
@js.objects.JsPlainObject
sealed external interface SpawnSyncOptionsWithBufferEncoding : SpawnSyncOptions {
@JsName("encoding")
var bufferEncoding: String /* "buffer" */?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

package node.childProcess

@kotlinx.js.JsPlainObject
@js.objects.JsPlainObject
sealed external interface SpawnSyncOptionsWithStringEncoding : SpawnSyncOptions {
@JsName("encoding")
var stringEncoding: node.buffer.BufferEncoding
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

package node.crypto

@kotlinx.js.JsPlainObject
@js.objects.JsPlainObject
sealed external interface CipherCCMOptions : node.stream.TransformOptions {
var authTagLength: Double
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

package node.crypto

@kotlinx.js.JsPlainObject
@js.objects.JsPlainObject
sealed external interface CipherGCMOptions : node.stream.TransformOptions {
var authTagLength: Double?
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

package node.crypto

@kotlinx.js.JsPlainObject
@js.objects.JsPlainObject
sealed external interface CipherOCBOptions : node.stream.TransformOptions {
var authTagLength: Double
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

package node.crypto

@kotlinx.js.JsPlainObject
@js.objects.JsPlainObject
sealed external interface HashOptions : node.stream.TransformOptions {
/**
* For XOF hash functions such as `shake256`, the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package node.dgram

import web.abort.Abortable

@kotlinx.js.JsPlainObject
@js.objects.JsPlainObject
sealed external interface SocketOptions : Abortable {
var type: SocketType
var reuseAddr: Boolean?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

package node.events

@kotlinx.js.JsPlainObject
@js.objects.JsPlainObject
sealed external interface StaticEventEmitterIteratorOptions : StaticEventEmitterOptions {
/**
* Names of events that will end the iteration.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package node.events

import web.abort.AbortSignal

@kotlinx.js.JsPlainObject
@js.objects.JsPlainObject
sealed external interface StaticEventEmitterOptions {
/**
* Can be used to cancel awaiting events.
Expand Down
Loading

0 comments on commit 40b373b

Please sign in to comment.