You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-11-29 22:48:10 +02:00
23 lines
907 B
TypeScript
23 lines
907 B
TypeScript
import { CallbackIds, SerializableData, SerializableDataAndCallbacks, TransferableCallback } from '../types';
|
|
import separateCallbacksFromSerializable from './separateCallbacksFromSerializable';
|
|
|
|
|
|
interface SeparatedCallbacksAndSerializableArrays {
|
|
serializableData: SerializableData[];
|
|
callbacks: CallbackIds[];
|
|
idToCallbacks: Record<string, TransferableCallback>;
|
|
}
|
|
|
|
const separateCallbacksFromSerializableArray = (args: SerializableDataAndCallbacks[]): SeparatedCallbacksAndSerializableArrays => {
|
|
const separatedArgs = separateCallbacksFromSerializable(args);
|
|
return {
|
|
idToCallbacks: separatedArgs.idToCallbacks,
|
|
|
|
// Because separateCallbacksFromSerializable is processing an array, it returns arrays.
|
|
callbacks: separatedArgs.callbacks as CallbackIds[],
|
|
serializableData: separatedArgs.serializableData as SerializableData[],
|
|
};
|
|
};
|
|
|
|
export default separateCallbacksFromSerializableArray;
|