book-cover-generator 1.9.0 → 1.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "book-cover-generator",
3
- "version": "1.9.0",
3
+ "version": "1.9.1",
4
4
  "description": "Generate SVG book covers from a title and an author. 39 styles, 28 palettes, seeded randomizer, zero dependencies.",
5
5
  "keywords": [
6
6
  "book",
@@ -0,0 +1,19 @@
1
+ import type { CoverOptions, createCover } from './index.js';
2
+
3
+ /**
4
+ * `<book-cover>`: a cover on any page, from its attributes (cover-title, author, subtitle, series,
5
+ * credit, badge, cover-style, genre, palette, seed, format, font, case, texture, variant, lang). It
6
+ * fires `cover` (detail: the cover) when it draws, and `cover-error` (detail: the error) when the
7
+ * attributes can't make one. With `loading="lazy"` it draws once it comes near the viewport, as an
8
+ * image does; until then it holds the cover's shape and is named for screen readers.
9
+ *
10
+ * (The class alone: Deno and JSR use these types, as a package there may not declare global ones.
11
+ * element.d.ts adds the tag to `document.createElement`'s types for TypeScript from npm.)
12
+ */
13
+ export declare class BookCover extends HTMLElement {
14
+ static observedAttributes: string[];
15
+ /** The cover drawn last, or null (before the first, or after an error). */
16
+ cover: ReturnType<typeof createCover> | null;
17
+ /** The cover's options, read from the attributes as the HTTP API reads a link. */
18
+ options(): CoverOptions;
19
+ }
package/src/element.d.ts CHANGED
@@ -1,19 +1,8 @@
1
- import type { CoverOptions, createCover } from './index.js';
1
+ // The types of book-cover-generator/element from npm: the class, and the tag in
2
+ // `document.createElement('book-cover')`'s types.
3
+ import { BookCover } from './element-types.js';
2
4
 
3
- /**
4
- * `<book-cover>`: a cover on any page, from its attributes (cover-title, author, subtitle, series,
5
- * credit, badge, cover-style, genre, palette, seed, format, font, case, texture, variant, lang). It
6
- * fires `cover` (detail: the cover) when it draws, and `cover-error` (detail: the error) when the
7
- * attributes can't make one. With `loading="lazy"` it draws once it comes near the viewport, as an
8
- * image does; until then it holds the cover's shape and is named for screen readers.
9
- */
10
- export declare class BookCover extends HTMLElement {
11
- static observedAttributes: string[];
12
- /** The cover drawn last, or null (before the first, or after an error). */
13
- cover: ReturnType<typeof createCover> | null;
14
- /** The cover's options, read from the attributes as the HTTP API reads a link. */
15
- options(): CoverOptions;
16
- }
5
+ export { BookCover };
17
6
 
18
7
  declare global {
19
8
  interface HTMLElementTagNameMap {
package/src/element.js CHANGED
@@ -1,4 +1,4 @@
1
- /* @ts-self-types="./element.d.ts" */
1
+ /* @ts-self-types="./element-types.d.ts" */
2
2
  // <book-cover>: a cover on any page, from its attributes.
3
3
  //
4
4
  // <script type="module" src="https://covers.otsirh.dev/src/element.js"></script>
package/src/index.js CHANGED
@@ -32,7 +32,7 @@ export { createMockup, mockupKinds } from './mockups.js';
32
32
  export { parseBookList } from './books.js';
33
33
 
34
34
  /** This version of the library (artwork for a seed can change between minor versions). */
35
- export const version = '1.9.0';
35
+ export const version = '1.9.1';
36
36
 
37
37
  /** The sizes a cover can have: each side `min` to `max` px, and neither more than `ratio` times the other. */
38
38
  export const sizeLimits = Object.freeze({ min: 50, max: 10000, ratio: 3 });