Add JS typing to remaining disk types (#52)

This commit is contained in:
Ian Flanigan 2021-01-04 00:00:40 +01:00 committed by GitHub
parent 715ea6ffaa
commit ab748b3aa6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 0 deletions

View File

@ -16,6 +16,11 @@ import ProDOS from './po';
import { numToString, debug } from '../util'; import { numToString, debug } from '../util';
/**
* Returns a `Disk` object from a 2mg image.
* @param {*} options the disk image and options
* @returns {import('./format_utils').Disk}
*/
export default function _2MG(options) { export default function _2MG(options) {
var OFFSETS = { var OFFSETS = {
CREATOR: 0x04, CREATOR: 0x04,

View File

@ -9,6 +9,11 @@
* implied warranty. * implied warranty.
*/ */
/**
* Returns a `Disk` object for a block volume with block-ordered data.
* @param {*} options the disk image and options
* @returns {import('./format_utils').Disk}
*/
export default function BlockVolume(options) { export default function BlockVolume(options) {
var { rawData, readOnly, name } = options; var { rawData, readOnly, name } = options;
var disk; var disk;

View File

@ -9,6 +9,11 @@
* implied warranty. * implied warranty.
*/ */
/**
* Returns a `Disk` object from raw nibble image data.
* @param {*} options the disk image and options
* @returns {import('./format_utils').Disk}
*/
export default function Nibble(options) { export default function Nibble(options) {
var { data, name, rawData, volume, readOnly } = options; var { data, name, rawData, volume, readOnly } = options;
var disk = { var disk = {

View File

@ -184,6 +184,11 @@ function MetaChunk(data) {
return this; return this;
} }
/**
* Returns a `Disk` object from Woz image data.
* @param {*} options the disk image and options
* @returns {import('./format_utils').Disk}
*/
export default function Woz(options) { export default function Woz(options) {
var { rawData } = options; var { rawData } = options;
var dv = new DataView(rawData, 0); var dv = new DataView(rawData, 0);