# @types/suncalc

> TypeScript definitions for suncalc

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

## Install

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

## 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.9.2 |
| Published | 2023-11-07 |
| First published | 2018-06-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51439 |
| Maintainers | types |

## Links

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

## Recent versions

- 1.9.2 (latest) — 2023-11-07
- 1.9.0 (ts4.1) — 2022-11-17
- 1.8.1 (ts3.6) — 2021-08-12
- 1.8.0 (ts2.0) — 2018-06-22
- 1.9.1 — 2023-10-18

## README

# Installation
> `npm install --save @types/suncalc`

# Summary
This package contains type definitions for suncalc (https://github.com/mourner/suncalc).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/suncalc.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/suncalc/index.d.ts)
````ts
export interface GetTimesResult {
    dawn: Date;
    dusk: Date;
    goldenHour: Date;
    goldenHourEnd: Date;
    nadir: Date;
    nauticalDawn: Date;
    nauticalDusk: Date;
    night: Date;
    nightEnd: Date;
    solarNoon: Date;
    sunrise: Date;
    sunriseEnd: Date;
    sunset: Date;
    sunsetStart: Date;
}
export interface GetSunPositionResult {
    altitude: number;
    azimuth: number;
}
export interface GetMoonPositionResult {
    altitude: number;
    azimuth: number;
    distance: number;
    parallacticAngle: number;
}
export interface GetMoonIlluminationResult {
    fraction: number;
    phase: number;
    angle: number;
}
export interface GetMoonTimes {
    rise: Date;
    set: Date;
    alwaysUp?: true;
    alwaysDown?: true;
}

export function getTimes(date: Date, latitude: number, longitude: number, height?: number): GetTimesResult;
export function addTime(angleInDegrees: number, morningName: string, eveningName: string): void;
export function getPosition(timeAndDate: Date, latitude: number, longitude: number): GetSunPositionResult;
export function getMoonPosition(timeAndDate: Date, latitude: number, longitude: number): GetMoonPositionResult;
export function getMoonIllumination(timeAndDate: Date): GetMoonIlluminationResult;
export function getMoonTimes(date: Date, latitude: number, longitude: number, inUTC?: boolean): GetMoonTimes;

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 15:11:36 GMT
 * Dependencies: none

# Credits
These definitions were written by [horiuchi](https://github.com/horiuchi).

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