1
0
mirror of https://github.com/troisjs/trois.git synced 2024-11-24 04:12:02 +08:00

fix props ts

This commit is contained in:
Kevin Levron 2021-04-26 19:54:56 +02:00
parent fda1ab4912
commit 49a0c1fef2
8 changed files with 14 additions and 14 deletions

View File

@ -6,7 +6,7 @@ const props = {
focus: { type: Number, default: 1 },
aperture: { type: Number, default: 0.025 },
maxblur: { type: Number, default: 0.01 },
}
} as const
export default defineComponent({
extends: EffectPass,

View File

@ -7,7 +7,7 @@ const props = {
scanlinesIntensity: { type: Number, default: 0.05 },
scanlinesCount: { type: Number, default: 4096 },
grayscale: { type: Number, default: 0 },
}
} as const
export default defineComponent({
extends: EffectPass,

View File

@ -9,7 +9,7 @@ const props = {
rotateG: { type: Number, default: Math.PI / 12 * 2 },
rotateB: { type: Number, default: Math.PI / 12 * 3 },
scatter: { type: Number, default: 0 },
}
} as const
export default defineComponent({
extends: EffectPass,

View File

@ -11,7 +11,7 @@ const props = {
gradientRadius: { type: Number, default: 100 },
start: { type: Object as PropType<Vector2PropInterface>, default: () => ({ x: 0, y: 100 }) },
end: { type: Object as PropType<Vector2PropInterface>, default: () => ({ x: 10, y: 100 }) },
}
} as const
interface TiltShiftPassSetupInterface {
uniforms1: {[name: string]: { value: any }}

View File

@ -7,7 +7,7 @@ const props = {
strength: { type: Number, default: 1.5 },
radius: { type: Number, default: 0 },
threshold: { type: Number, default: 0 },
}
} as const
export default defineComponent({
extends: EffectPass,

View File

@ -9,7 +9,7 @@ const props = {
bumpScale: { type: Number, default: 1 },
displacementBias: { type: Number, default: 0 },
displacementScale: { type: Number, default: 1 },
emissive: { type: [Number, String], default: 0 },
emissive: { type: [String, Number] as PropType<string | number>, default: 0 },
emissiveIntensity: { type: Number, default: 1 },
envMapIntensity: { type: Number, default: 1 },
lightMapIntensity: { type: Number, default: 1 },
@ -18,7 +18,7 @@ const props = {
roughness: { type: Number, default: 1 },
refractionRatio: { type: Number, default: 0.98 },
flatShading: Boolean,
}
} as const
export default defineComponent({
extends: Material,

View File

@ -1,18 +1,18 @@
import { defineComponent } from 'vue'
import { defineComponent, PropType } from 'vue'
import { Color, ShaderMaterial, UniformsUtils } from 'three'
import SubsurfaceScatteringShader from './SubsurfaceScatteringShader'
import Material from './Material'
// import { bindProps, propsValues } from '../tools'
const props = {
color: { type: [String, Number], default: '#ffffff' },
thicknessColor: { type: [String, Number], default: '#ffffff' },
color: { type: [String, Number] as PropType<string | number>, default: '#ffffff' },
thicknessColor: { type: [String, Number] as PropType<string | number>, default: '#ffffff' },
thicknessDistortion: { type: Number, default: 0.4 },
thicknessAmbient: { type: Number, default: 0.01 },
thicknessAttenuation: { type: Number, default: 0.7 },
thicknessPower: { type: Number, default: 2 },
thicknessScale: { type: Number, default: 4 },
}
} as const
export default defineComponent({
extends: Material,

View File

@ -1,4 +1,4 @@
import { defineComponent, watch } from 'vue'
import { defineComponent, PropType, watch } from 'vue'
import { Font, FontLoader, TextGeometry } from 'three'
import Mesh, { MeshSetupInterface } from './Mesh'
@ -19,8 +19,8 @@ const props = {
bevelSize: { type: Number, default: 8 },
bevelOffset: { type: Number, default: 0 },
bevelSegments: { type: Number, default: 5 },
align: { type: [Boolean, String], default: false },
}
align: { type: [Boolean, String] as PropType<boolean | string>, default: false },
} as const
export default defineComponent({
extends: Mesh,