import { CookieAttributes } from "js-cookie";

let internalSetCookie = (name: string, value: string, options?: CookieAttributes) => {};
let internalGetCookie = (name: string): string | undefined => {
    return undefined;
};

// mobius can't reference setCookie directly, so Cookies calls this to allow mobius to call setCookie
export function setupSetCookie(value: typeof internalSetCookie) {
    internalSetCookie = value;
}

export const setCookie = (...params: Parameters<typeof internalSetCookie>) => {
    internalSetCookie(...params);
};

export function setupGetCookie(value: typeof internalGetCookie) {
    internalGetCookie = value;
}

export const getCookie = (...params: Parameters<typeof internalGetCookie>) => {
    return internalGetCookie(...params);
};
