# @types/geopattern

> TypeScript definitions for geopattern

Latest version **1.2.9** (published 2023-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/geopattern
pnpm add @types/geopattern
yarn add @types/geopattern
bun add @types/geopattern
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.2.9 |
| Published | 2023-11-07 |
| First published | 2016-12-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51450 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/geopattern
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/geopattern
- npm.io page: https://npm.io/package/@types/geopattern

## Recent versions

- 1.2.9 (latest) — 2023-11-07
- 1.2.6 (ts3.8) — 2021-11-24
- 1.2.5 (ts3.6) — 2021-07-08
- 1.2.4 (ts3.0) — 2020-05-15
- 1.2.3 (ts2.3) — 2019-02-13
- 1.2.1 (ts2.0) — 2016-12-30
- 1.2.8 — 2023-10-18
- 1.2.7 — 2023-09-20
- 1.2.2 — 2017-06-15
- 1.2.0 — 2016-12-30

## README

# Installation
> `npm install --save @types/geopattern`

# Summary
This package contains type definitions for geopattern (https://github.com/btmills/geopattern).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/geopattern.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/geopattern/index.d.ts)
````ts
/// <references types="jquery" />

export as namespace GeoPattern;

/**
 * Returns a newly-generated, tiling SVG Pattern.
 *
 * @param string Will be hashed using the SHA1 algorithm, and the resulting hash
 * will be used as the seed for generation.
 */
export function generate(string?: string, options?: PatternOptions): Pattern;

export interface PatternOptions {
    /**
     * Specify an exact background color. This is a CSS hexadecimal color
     * value.
     */
    color?: string | undefined;

    /**
     * Controls the relative background color of the generated image. The color
     * is not identical to that used in the pattern because the hue is rotated
     * by the generator. This is a CSS hexadecimal color value, which defaults
     * to #933c3c.
     */
    baseColor?: string | undefined;

    /**
     * Determines the pattern. All of the original patterns from the Ruby
     * version at jasonlong/geo_pattern are available in this port, and their
     * names are camelCased.
     */
    generator?: GeneratorType | undefined;
}

export type GeneratorType =
    | "chevrons"
    | "octogons"
    | "overlappingCircles"
    | "plusSigns"
    | "xes"
    | "sineWaves"
    | "hexagons"
    | "overlappingRings"
    | "plaid"
    | "triangles"
    | "squares"
    | "nestedSquares"
    | "mosaicSquares"
    | "concentricCircles"
    | "diamonds"
    | "tessellation";

export interface Pattern {
    /** Gets the pattern's background color as a hexadecimal string. */
    color: string;

    /** Gets the SVG string representing the pattern. */
    toString(): string;

    /** Gets the SVG string representing the pattern. */
    toSvg(): string;

    /** Gets the SVG as a Base64-encoded string. */
    toBase64(): string;

    /**
     * Gets the pattern as a data URI,
     * i.e. data:image/svg+xml;base64,PHN2ZyB...
     */
    toDataUri(): string;

    /**
     * Gets the pattern as a data URL suitable for use as a CSS
     * background-image, i.e. url("data:image/svg+xml;base64,PHN2ZyB...").
     */
    toDataUrl(): string;
}

declare global {
    interface JQuery {
        geopattern(string: string, options?: PatternOptions): JQuery;
    }
}

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 03:09:37 GMT
 * Dependencies: none

# Credits
These definitions were written by [Gaelan](https://github.com/Gaelan).

---
_Source: https://npm.io/package/@types/geopattern · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
