signal-desktop/ts/storybook/Fixtures.ts
2020-04-15 14:44:46 -07:00

30 lines
838 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// @ts-ignore
import gif from '../../fixtures/giphy-GVNvOUpeYmI7e.gif';
// @ts-ignore
import png from '../../fixtures/freepngs-2cd43b_bed7d1327e88454487397574d87b64dc_mv2.png';
// @ts-ignore
import landscapeGreen from '../../fixtures/1000x50-green.jpeg';
// @ts-ignore
import landscapePurple from '../../fixtures/200x50-purple.png';
function makeObjectUrl(data: ArrayBuffer, contentType: string): string {
const blob = new Blob([data], {
type: contentType,
});
return URL.createObjectURL(blob);
}
// 320x240
export const gifObjectUrl = makeObjectUrl(gif, 'image/gif');
// 800×1200
export const pngObjectUrl = makeObjectUrl(png, 'image/png');
export const landscapeGreenObjectUrl = makeObjectUrl(
landscapeGreen,
'image/jpeg'
);
export const landscapePurpleObjectUrl = makeObjectUrl(
landscapePurple,
'image/png'
);