Skip to content

Commit

Permalink
Initial version after transliteration from jsofa
Browse files Browse the repository at this point in the history
there have been some manual tweaks, but it mainly still
has a 'Java'-like feel. The api might change slightly to be more idiomatic TypeScript in places.
  • Loading branch information
pahjbo committed Jan 5, 2024
1 parent 2846307 commit dcf4a0e
Show file tree
Hide file tree
Showing 17 changed files with 29,048 additions and 2 deletions.
21 changes: 21 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"env": {
"browser": true,
"es2021": true,
"node": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": [
"@typescript-eslint"
],
"rules": {
}
}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/node_modules/
/.idea/
/dist/
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@tsastro:registry=https://npm.pkg.github.com
5 changes: 5 additions & 0 deletions Developing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Developing
==========

The library was created from an automated transliteration of the [JSOFA library](https://github.com/Javastro/jsofa) using [jsweet](https://www.jsweet.org). There has been some hand editing of the code since the automatic transliteration, and it is expected that any updates from the upstream IAU SOFA library will also be hand written.

Binary file added LICENSE.txt
Binary file not shown.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# tsofa
TypeScript Transliteration of the IAU SOFA library
# TSOFA
TypeScript transliteration of the [IAU SOFA](http://www.iausofa.org) library.



49 changes: 49 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"name": "@tsastro/tsofa",
"version": "18.0.0",
"type": "module",
"description": "a typescript transcription of the IAU SOFA library",
"author": "Paul Harrison <[email protected]>",
"license": "MIT",
"private": false,
"scripts": {
"build": "tsc",
"test": "testyts",
"doc": "typedoc src/main/ts/TSOFA.ts",
"eslint": "eslint ."
},
"main": "dist/TSOFA.js",
"types": "dist/TSOFA.d.ts",
"files": [
"/dist"
],
"repository": {
"type": "git",
"url": "git+https://github.com/tsastro/tsofa.git"
},
"publishConfig": {
"registry": "https://npm.pkg.github.com"
},
"keywords": [
"Astrometry",
"Astronomy"
],
"bugs": {
"url": "https://github.com/tsastro/tsofa/issues"
},
"homepage": "https://github.com/tsastro/tsofa#readme",
"devDependencies": {
"@types/node": "^20.7.1",
"@typescript-eslint/eslint-plugin": "^6.17.0",
"@typescript-eslint/parser": "^6.17.0",
"eslint": "^8.49.0",
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-jsdoc": "^46.8.1",
"eslint-plugin-prefer-arrow": "^1.2.3",
"testyts": "^1.5.0",
"ts-node": "^10.9.1",
"typedoc": "^0.25.6",
"typescript": "^5.2.2"
},
"dependencies": {}
}
22,331 changes: 22,331 additions & 0 deletions src/main/ts/TSOFA.ts

Large diffs are not rendered by default.

37 changes: 37 additions & 0 deletions src/main/ts/TSOFAException.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/* Generated from Java with JSweet 3.1.0 - http://www.jsweet.org */
/**
* Base class for TSOFA exceptions.
* .
* @author Paul Harrison ([email protected]) 21 Nov 2011
* @version $Revision$ $date$
* @param {string} message
* @param {number} status
* @class
* @extends Error
*/
export class TSOFAException extends Error {
/**
* Comment for <code>serialVersionUID</code>
*/
static serialVersionUID: number = 4100437038026589596;

/**
* Original TSOFA status value;
*/
/*private*/ status: number;

public getStatus(): number {
return this.status;
}

public constructor(message: string, status: number) {
super(message); this.message=message;
(<any>Object).setPrototypeOf(this, TSOFAException.prototype);
if (this.status === undefined) { this.status = 0; }
this.status = status;
}
}
TSOFAException["__class"] = "org.jastronomy.TSOFA.TSOFAException";



25 changes: 25 additions & 0 deletions src/main/ts/TSOFAFailedConvergenceException.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/* Generated from Java with JSweet 3.1.0 - http://www.jsweet.org */

import { TSOFAException } from "./TSOFAException";
/**
* Exception reporting some form of convergence failure in an algorithm.
* @param {string} message
* @param {number} status
* @class
* @extends TSOFAException
*/
export class TSOFAFailedConvergenceException extends TSOFAException {
/**
* Comment for <code>serialVersionUID</code>
*/
static __org_jastronomy_TSOFA_TSOFAFailedConvergenceException_serialVersionUID: number = 4417087001300889769;

public constructor(message: string, status: number) {
super(message, status);
(<any>Object).setPrototypeOf(this, TSOFAFailedConvergenceException.prototype);
}
}
TSOFAFailedConvergenceException["__class"] = "org.jastronomy.TSOFA.TSOFAFailedConvergenceException";



27 changes: 27 additions & 0 deletions src/main/ts/TSOFAIllegalParameter.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/* Generated from Java with JSweet 3.1.0 - http://www.jsweet.org */
import { TSOFAException } from "./TSOFAException";
/**
* Various forms of illegal parameters are reported with this execption.
* .
* @author Paul Harrison ([email protected]) 21 Nov 2011
* @version $Revision$ $date$
* @param {string} message
* @param {number} status
* @class
* @extends org.jastronomy.TSOFA.TSOFAException
*/
export class TSOFAIllegalParameter extends TSOFAException {
/**
* Comment for <code>serialVersionUID</code>
*/
static __org_jastronomy_jsofa_TSOFAIllegalParameter_serialVersionUID: number = 4164536110692125140;

public constructor(message: string, status: number) {
super(message, status);
(<any>Object).setPrototypeOf(this, TSOFAIllegalParameter.prototype);
}
}
TSOFAIllegalParameter["__class"] = "org.jastronomy.jsofa.TSOFAIllegalParameter";



26 changes: 26 additions & 0 deletions src/main/ts/TSOFAInternalError.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/* Generated from Java with JSweet 3.1.0 - http://www.jsweet.org */
import { TSOFAException } from "./TSOFAException";
/**
* Exception signalling a internal error.
* .
* @author Paul Harrison ([email protected]) 21 Nov 2011
* @version $Revision$ $date$
* @param {string} message
* @param {number} status
* @class
* @extends org.jastronomy.jsofa.TSOFAException
*/
export class TSOFAInternalError extends TSOFAException {
/**
* Comment for <code>serialVersionUID</code>
*/
static __org_jastronomy_jsofa_TSOFAInternalError_serialVersionUID: number = 6067803703985219165;

public constructor(message: string, status: number) {
super(message, status);
(<any>Object).setPrototypeOf(this, TSOFAInternalError.prototype);
}
}
TSOFAInternalError["__class"] = "org.jastronomy.jsofa.TSOFAInternalError";


Loading

0 comments on commit dcf4a0e

Please sign in to comment.