"use strict";

exports.__esModule = true;
exports.addRemoteFileInterfaceFields = addRemoteFileInterfaceFields;
exports.getOrCreateRemoteFileInterface = getOrCreateRemoteFileInterface;
exports.DEFAULT_BREAKPOINTS = exports.DEFAULT_PIXEL_DENSITIES = void 0;

var _index = require("../../redux/index");

var _polyfillRemoteFile = require("gatsby-plugin-utils/polyfill-remote-file");

const DEFAULT_PIXEL_DENSITIES = [0.25, 0.5, 1, 2];
exports.DEFAULT_PIXEL_DENSITIES = DEFAULT_PIXEL_DENSITIES;
const DEFAULT_BREAKPOINTS = [750, 1080, 1366, 1920];
exports.DEFAULT_BREAKPOINTS = DEFAULT_BREAKPOINTS;

function addRemoteFileInterfaceFields(schemaComposer, typeComposer) {
  const remoteFileInterfaceType = getOrCreateRemoteFileInterface(schemaComposer); // eslint-disable-next-line @typescript-eslint/no-explicit-any

  typeComposer.addFields(remoteFileInterfaceType.getFields());
}

function getOrCreateRemoteFileInterface( // eslint-disable-next-line @typescript-eslint/no-explicit-any
schemaComposer) {
  const enums = (0, _polyfillRemoteFile.getRemoteFileEnums)(schemaComposer.createEnumTC.bind(schemaComposer));
  schemaComposer.getOrCreateOTC(`RemoteFileResize`, tc => {
    tc.addFields({
      width: `Int`,
      height: `Int`,
      src: `String`
    });
  });
  return schemaComposer.getOrCreateIFTC(`RemoteFile`, tc => {
    tc.setDescription(`Remote Interface`); // @ts-ignore - types are messed up by schema composer maybe new version helps here

    tc.addFields((0, _polyfillRemoteFile.getRemoteFileFields)(enums, _index.store));
  });
}
//# sourceMappingURL=remote-file-interface.js.map