|
@@ -259,7 +259,7 @@ export class Resource {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * Symbol to be used to implement a special function
|
|
|
|
|
|
+ * A key to be used to implement a special function
|
|
* on your types that define how your type should be serialized
|
|
* on your types that define how your type should be serialized
|
|
* when passing across the IPC.
|
|
* when passing across the IPC.
|
|
* @example
|
|
* @example
|
|
@@ -274,7 +274,7 @@ export class Resource {
|
|
* `UserId::String("id")` would be serialized into `{ String: "id" }`
|
|
* `UserId::String("id")` would be serialized into `{ String: "id" }`
|
|
* and so we need to pass the same structure back to Rust
|
|
* and so we need to pass the same structure back to Rust
|
|
* ```ts
|
|
* ```ts
|
|
- * import { ToIPCSymbol } from "@tauri-apps/api/core"
|
|
|
|
|
|
+ * import { ToIPCKey } from "@tauri-apps/api/core"
|
|
*
|
|
*
|
|
* class UserIdString {
|
|
* class UserIdString {
|
|
* id
|
|
* id
|
|
@@ -282,7 +282,7 @@ export class Resource {
|
|
* this.id = id
|
|
* this.id = id
|
|
* }
|
|
* }
|
|
*
|
|
*
|
|
- * [ToIPCSymbol]() {
|
|
|
|
|
|
+ * [ToIPCKey]() {
|
|
* return { String: this.id }
|
|
* return { String: this.id }
|
|
* }
|
|
* }
|
|
* }
|
|
* }
|
|
@@ -293,7 +293,7 @@ export class Resource {
|
|
* this.id = id
|
|
* this.id = id
|
|
* }
|
|
* }
|
|
*
|
|
*
|
|
- * [ToIPCSymbol]() {
|
|
|
|
|
|
+ * [ToIPCKey]() {
|
|
* return { Number: this.id }
|
|
* return { Number: this.id }
|
|
* }
|
|
* }
|
|
* }
|
|
* }
|
|
@@ -306,7 +306,7 @@ export class Resource {
|
|
// if this value changes, make sure to update it in:
|
|
// if this value changes, make sure to update it in:
|
|
// 1. ipc.js
|
|
// 1. ipc.js
|
|
// 2. process-ipc-message-fn.js
|
|
// 2. process-ipc-message-fn.js
|
|
-export const ToIPCSymbol = '__TAURI_TO_IPC__'
|
|
|
|
|
|
+export const ToIPCKey = '__TAURI_TO_IPC_KEY__'
|
|
|
|
|
|
function isTauri(): boolean {
|
|
function isTauri(): boolean {
|
|
return 'isTauri' in window && !!window.isTauri
|
|
return 'isTauri' in window && !!window.isTauri
|