all files / src/imageLoader/internal/ options.js

100% Statements 3/3
100% Branches 0/0
100% Functions 2/2
100% Lines 3/3
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22                                   51×    
let options = {
  // callback allowing customization of the xhr (e.g. adding custom auth headers, cors, etc)
  beforeSend (/* xhr, imageId */) {
  },
  // callback allowing modification of newly created image objects
  imageCreated (/* image */) {
  },
  strict: false,
  useWebWorkers: true,
  decodeConfig: {
    usePDFJS: false
  }
};
 
export function setOptions (newOptions) {
  options = Object.assign(options, newOptions);
}
 
export function getOptions () {
  return options;
}