const doOnceFlags = {};
/**
 * If the key was passed before, then do NOT execute the func
 */
const doOnce = (func, key) => {
    if (doOnceFlags[key]) {
        return;
    }
    func();
    doOnceFlags[key] = true;
};
export const logDeprecation = (logger, typeName, oldProp, newProp, message) => {
    const newPropMsg = newProp ? `Please use '${typeName}.${newProp}()' instead. ` : '';
    doOnce(() => logger.consoleWarn(`${typeName}.${oldProp}() is deprecated. ${newPropMsg}${message ?? ''}`), `Deprecated_${oldProp}`);
};
export const logDeprecationExternal = (logger, oldTypeName, oldProp, newTypeName, newProp, message) => {
    const newPropMsg = newProp ? `Please use '${newTypeName}.${newProp}()' instead. ` : '';
    doOnce(() => logger.consoleWarn(`${oldTypeName}.${oldProp}() is deprecated. ${newPropMsg}${message ?? ''}`), `Deprecated_${oldProp}`);
};
export const logDeprecationInternal = (logger, typeName, oldProp) => {
    doOnce(() => logger.consoleWarn(`${typeName}.${oldProp}() is deprecated and will be removed in the next major release. Contact support if you need this functionality.`), `Deprecated_${oldProp}`);
};
