mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
28 lines
826 B
TypeScript
28 lines
826 B
TypeScript
// Type definitions for srcset 1.0
|
|
// Project: https://github.com/sindresorhus/srcset#readme
|
|
// Definitions by: BendingBender <https://github.com/BendingBender>
|
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
|
|
/**
|
|
* Parse the HTML `<img>`
|
|
* [srcset](http://mobile.smashingmagazine.com/2013/08/21/webkit-implements-srcset-and-why-its-a-good-thing/) attribute.
|
|
*
|
|
* @param srcset An srcset string.
|
|
*/
|
|
export function parse(srcset: string): SrcSetDefinition[];
|
|
|
|
/**
|
|
* Stringify a list of `SrcSetDefinition`s.
|
|
*
|
|
* @param srcSetDefinitions An array of `SrcSetDefinition` object.
|
|
* @returns A srcset string.
|
|
*/
|
|
export function stringify(srcSetDefinitions: SrcSetDefinition[]): string;
|
|
|
|
export interface SrcSetDefinition {
|
|
url: string;
|
|
width?: number;
|
|
height?: number;
|
|
density?: number;
|
|
}
|