/*
 * Copyright (c) 2017 NumberFour AG.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *   NumberFour AG - Initial API and implementation
 */

export external public interface ~PathObject {
    public root: string;
    public dir: string;
    public base: string;
    public ext: string;
    public name: string;
}

export external public const delimiter: string;
export external public const sep: string;
export external public function basename(path: string, ext: string=): string;
export external public function dirname(path: string): string;
export external public function extname(path: string): string;
export external public function format(pathObject: PathObject): string;
export external public function isAbsolute(path: string): boolean;
export external public function join(...path: string): string;
export external public function normalize(path: string): string;
export external public function parse(pathString: string): PathObject;
export external public function relative(from: string, to: string): string;
export external public function resolve(...path: string): string; //not exact. see https://nodejs.org/api/path.html#path_path_resolve_from_to

export external public const posix: ~Object with {
    basename: {function(path: string, ext: string=):string};
    dirname: {function(path: string): string};
    extname: {function(path: string): string};
    format: {function(pathObject: PathObject): string};
    isAbsolute: {function(path: string): boolean};
    join: {function(...path: string): string};
    normalize: {function(path: string): string};
    parse: {function(pathString: string): PathObject};
    relative: {function(from: string, to: string): string};
    resolve: {function(...path: string): string};
};

export external public const win32: ~Object with {
    basename: {function(path: string, ext: string=):string};
    dirname: {function(path: string): string};
    extname: {function(path: string): string};
    format: {function(pathObject: PathObject): string};
    isAbsolute: {function(path: string): boolean};
    join: {function(...path: string): string};
    normalize: {function(path: string): string};
    parse: {function(pathString: string): PathObject};
    relative: {function(from: string, to: string): string};
    resolve: {function(...path: string): string};
};


