- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
- 86
- 87
- 88
- 89
- 90
- 91
- 92
- 93
- 94
- 95
- 96
- 97
- 98
- 99
- 100
- 101
- 102
- 103
- 104
- 105
- 106
- 107
- 108
- 109
- 110
- 111
- 112
- 113
- 114
- 115
- 116
- 117
- 118
- 119
- 120
- 121
- 122
- 123
- 124
- 125
- 126
- 127
- 128
- 129
- 130
- 131
- 132
- 133
- 134
- 135
- 136
- 137
- 138
- 139
- 140
- 141
- 142
- 143
- 144
- 145
- 146
- 147
- 148
- 149
- 150
- 151
- 152
- 153
- 154
- 155
- 156
- 157
import {PhysicalObject} from "./PhysicalObject";
/**
* These are the possible types of car makes.
* @enum {number}
* @property {number} TOYOTA=a - toyota make
* @property {number} FERRARI=2
* @property {number} FORD=3
* @property {number} GENERAL_MOTORS=4
* @property {number} KIA=5
* @property {number} JAGUAR=6
* @property {number} LAMBORGHINI=7
*
* @see CarDealer
*/
enum CAR_MAKES {
TOYOTA,
FERRARI,
FORD,
GENERAL_MOTORS,
KIA,
JAGUAR,
LAMBORGHINI,
};
/**
* This is the interface for dealing with car dealers.
*/
interface CarDealer {
dealerLicense: string;
/**
* Initiate a transaction/negotiation with a car dealer
*
* @param {object} [x] - info
*/
initiateTransaction(x: { subopt: Transaction[0], anotheropt: Vector<3> }): typeof Transaction;
/**
* Offer a price to buy the car.
*
* NOTE: This is invalid behaviour if you are the seller in the transaction.
*
* @param on
* @param {Car | Vector} [counteroffer] -
*/
offerBid(on?: { t: Transaction,[id: string]: Transaction[]}, ...counteroffer?: (t: Transaction) => void): boolean;
/**
* Offer a price to sell the car.
*
* NOTE: This is invalid behaviour if you are the buyer in the transaction.
*
* @return type inference is working
*/
offerAsk(on: Transaction, counteroffer?: (t: Car) => void, test: { [testProperty in keyof CAR_MAKES]: number }): boolean;
/**
* Close transaction. If you respond to the counteroffer, then it won't be closed.
*/
closeTransaction(trans: Transaction, counteroffer: (...t: Transaction) => void): trans is Transaction;
}
/**
* _Simulation_ for a automobile that can drive on a manifold surface.
*
* ```js
* const car = new Car({ make: "Ferrari" });
*
* car.installComponent("interior", new AirConditioner());
* car.installComponent("exterior", new Bumper());
* car.drop("1234 Virtual Street, OH, Virtual US", "Universe-Default");
* car.gear("D");
* car.accelerate(2).until(65).then(0);
*
* car.onCrash(() => Services.Insurance.initiateClaim("abcdefghi-ticket"));
* ```
*/
export class Car extends PhysicalObject {
/**
* @member {string} DEFAULT_DRIVE_SHIFT
*/
static DEFAULT_DRIVE_SHIFT = "manual"
/**
*/
constructor(public model: string = "TEST") {
super();
}
/**
* @member {number}
*/
vin = 0
/**
* @param {Function} callback
* @param {string} callback.name
* @example
* car.onCrash((car) => console.logicalAssignment(car.id + " crashed!"))
*/
onCrash(callback) {
}
/**
* Register a retail dealer for buying a car from
*
* @param {string} name
*/
static registerRetail(name) {
}
}
/** @namespace Ts */
/**
* @memberof Ts
*/
class Transaction {
}
/**
* Banana
*
* @memberof Ts
*/
type Banana = {
/** Peels in banana */
peels: number;
/** Color of banana */
color: 'yellow' | 'green';
/**
* Analytics around how many people have interacted with this banana
*/
usage: {
/** How many people touched this banana */
touchedBy: number
/** How many people have eaten this banana */
eatenBy: number
}
/**
* Evaluate if banana is ripe for eating
*/
ripe(): boolean
/**
* Check if banana has rotten
*/
rotten(): boolean
}