@lppedd/kotlinx-charset 0.1.2 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
# kotlinx-charset
|
|
2
2
|
|
|
3
|
-

|
|
4
|
-

|
|
5
|
-
](https://github.com/lppedd/kotlinx-charset/actions/workflows/build.yml)
|
|
4
|
+
[](./LICENSE)
|
|
5
|
+
[](https://kotlinlang.org)
|
|
6
6
|
[](https://mvnrepository.com/artifact/com.lppedd.kotlinx-charset)
|
|
7
|
+
[](https://www.npmjs.com/package/@lppedd/kotlinx-charset)
|
|
7
8
|
|
|
8
9
|
Minimal charset support for Kotlin Multiplatform.
|
|
9
10
|
|
|
@@ -76,7 +77,7 @@ and encode strings, using top-level functions exported via ECMAScript modules.
|
|
|
76
77
|
> [!TIP]
|
|
77
78
|
> Avoid using this module when consuming `kotlinx-charset` from a Kotlin project
|
|
78
79
|
|
|
79
|
-
You can depend on the [@lppedd/kotlinx-charset][
|
|
80
|
+
You can depend on the [@lppedd/kotlinx-charset][npm] npm package.
|
|
80
81
|
For example, consuming the library from TypeScript would look like:
|
|
81
82
|
|
|
82
83
|
```ts
|
|
@@ -104,4 +105,4 @@ Both the `decode` and `encode` functions will throw an `Error`
|
|
|
104
105
|
if the specified charset does not exist or if an error occurs
|
|
105
106
|
during data processing.
|
|
106
107
|
|
|
107
|
-
[
|
|
108
|
+
[npm]: https://www.npmjs.com/package/@lppedd/kotlinx-charset
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
type Nullable<T> = T | null | undefined
|
|
2
|
+
declare function KtSingleton<T>(): T & (abstract new() => any);
|
|
2
3
|
export declare interface XCharset {
|
|
3
4
|
readonly name: string;
|
|
4
5
|
readonly aliases: Array<string>;
|
|
@@ -24,7 +25,8 @@ export declare interface XCharsetEncoder {
|
|
|
24
25
|
readonly "com.lppedd.kotlinx.charset.exported.XCharsetEncoder": unique symbol;
|
|
25
26
|
};
|
|
26
27
|
}
|
|
27
|
-
export declare function
|
|
28
|
+
export declare function getCharsetOrNull(charsetName: string): Nullable<XCharset>;
|
|
28
29
|
export declare function getCharset(charsetName: string): XCharset;
|
|
30
|
+
export declare function getCharsets(): Array<XCharset>;
|
|
29
31
|
export declare function decode(charsetName: string, bytes: Uint8Array): string;
|
|
30
32
|
export declare function encode(charsetName: string, value: string): Uint8Array;
|