<commit_before>// asset/types - WIP - main asset types and functions
// Part of Stardazed
// (c) 2015-2017 by <NAME> - @zenmumbler
// https://github.com/stardazed/stardazed

namespace sd.asset {

	export interface Asset {
		guid: string;
		kind: string;
		name?: string;
	}

	let nextAssetID = 1;
	const nextAnonymousAssetGUID = (kind: string, name: string) =>
		`${kind}_${name || "anonymous"}_${nextAssetID++}_${performance.now().toFixed(2)}`;

	export const makeAsset = (kind: string, name?: string, guid?: string): Asset => ({
		guid: guid || nextAnonymousAssetGUID(kind, name || ""),
		kind,
		name
	});

	export const isAsset = (a: any): a is Asset =>
		typeof a === "object" &&
		typeof a.guid === "string" &&
		typeof a.kind === "string" &&
		(a.name === void 0 || typeof a.name === "string");


	// ------------------------

	export interface Audio extends Asset {
		buffer: AudioBuffer;
	}

	export interface Image extends Asset {
		provider: image.PixelDataProvider;
	}

	// ------------------------

	export interface TextureSampler extends Asset {
		sampler: render.Sampler;
	}

	export interface Texture2D extends Asset {
		texture: render.Texture;
		samplerAsset?: TextureSampler; // hmm
		anisotropy: number; // 1..16
	}

	export const enum AlphaCoverage {
		Ignore,
		Mask,
		Transparent
	}

	export interface DiffuseColourResponse {
		type: "diffuse";
		baseColour: Float3;<commit_msg>feat(asset): add Binary asset type<commit_after>// asset/types - WIP - main asset types and functions
// Part of Stardazed
// (c) 2015-2017 by <NAME> - @zenmumbler
// https://github.com/stardazed/stardazed

namespace sd.asset {

	export interface Asset {
		guid: string;
		kind: string;
		name?: string;
	}

	let nextAssetID = 1;
	const nextAnonymousAssetGUID = (kind: string, name: string) =>
		`${kind}_${name || "anonymous"}_${nextAssetID++}_${performance.now().toFixed(2)}`;

	export const makeAsset = (kind: string, name?: string, guid?: string): Asset => ({
		guid: guid || nextAnonymousAssetGUID(kind, name || ""),
		kind,
		name
	});

	export const isAsset = (a: any): a is Asset =>
		typeof a === "object" &&
		typeof a.guid === "string" &&
		typeof a.kind === "string" &&
		(a.name === void 0 || typeof a.name === "string");


	// ------------------------

	export interface Binary extends Asset {
		buffer: ArrayBuffer;
	}

	export interface Audio extends Asset {
		buffer: AudioBuffer;
	}

	export interface Image extends Asset {
		provider: image.PixelDataProvider;
	}

	// ------------------------

	export interface TextureSampler extends Asset {
		sampler: render.Sampler;
	}

	export interface Texture2D extends Asset {
		texture: render.Texture;
		samplerAsset?: TextureSampler; // hmm
		anisotropy: number; // 1..16
	}

	export const enum AlphaCoverage {
		Ignore,
		Mask,
		Transparent
	}

	export interface DiffuseColourResponse {
		type: "diffuse";
		baseColour: Float3;
{'fraction_non_alphanumeric': 0.170293609671848, 'fraction_numerical': 0.011053540587219343, 'mean_word_length': 3.178932178932179, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3173650', 'n_tokens_mistral': 1025, 'n_tokens_neox': 904, 'n_words': 262}